如果條件是什麼錯?如果條件和計數器遞增
if ((@rent_amt_h <> '0.000') or (@house_payment_amt_h <> '0.000') or (@insurance_amt_h <> '0.000')or (@property_taxes_amt_h <> '0.000') or (@gas_amt_u <> '0.000') or (@elec_amt_u <> '0.000') or (@otherfuel_amt_u <> '0.000') or (@Trash_Collection_amt_u <> '0.000') or (@Sewerage_amt_u <> '0.000') or (@Telephone_amt_u <> '0.000') or (@water_amt_u <> '0.000') or (@other_house_amt_h <> '0.000') or (@other_amt_u <> '0.000') or (@total_u <> '0.000'))
begin
SET @APPSHELTER_COUNT = (select Count(APP_ID) FROM ext_app_group_other_expenses (nolock) WHERE APP_ID = @App_Id)
end
else
begin
SET @APPSHELTER_COUNT = 0
end
它會增加@APPSHELTER_COUNT值,即使if條件中的值爲零!它從不將值設置爲0?
感謝您的幫助。
你在if語句中有14個子句 - 難以閱讀和無法維護 – Jason 2011-05-20 21:17:49