Right i've ran into another problem
in my table i have the following columns:
i=integer, b=bit, m=smallmoney
so i need to perform a query on the details above.Code:iNoCoachMovements , bChargePerCoach, mCoachFee 3, 1, 50.00 3, 0, 100.00 0, 0, 100.00
the way it will work is that
is this possible in a SQL Query.Code:if bChargePerCoach = 1 then iNoCoachMovements * mCoachFee elseif iNoCoachMovements > 0 Then mCoachFee else 0 end if
it works for the 1st part with the sql below:
Code:SUM(CASE WHEN (dbo.tbl_Contracts.bChargePerCoach = 1) THEN (dbo.tbl_Despatches.iNoCoachMovements * dbo.tbl_Contracts.mCoachFee) ELSE 0 END)



Reply With Quote

