如果使用我的查询检查复选框

时间:2013-12-12 17:33:11

标签: mysql sql if-statement

FindInsurance(
 @Amount DECIMAL(18,2),
 @Freight DECIMAL(18,2),
 @FreightType VARCHAR(50),
 @UseFreight BIT
) AS
SET @FreightType = (Select FreightType From tblFreight Where FreightType= @FreightType)
SET @UseFreight = (Select UseFreight From tblFreight Where UseFreight= 'TRUE')

IF FreightType = @FreightType and UseFreight= @UseFreight
BEGIN
    SET NOCOUNT ON
     SELECT
        FreightType,InsuranceRate,InsuranceRate * (@Amount + @Freight) AS Insurance
       FROM
        tblFreight
Else 
SELECT
        FreightType,InsuranceRate,InsuranceRate * (@Amount) AS Insurance
       FROM
        tblFreight
END
End If

我希望能够选择一个惊吓名称,如果复选框检查它们,则计算是否为false,它会执行不同的计算

0 个答案:

没有答案