Board index » delphi » conditional statement in SQL calc field

conditional statement in SQL calc field

Hello

I would like to use a TQuery to replace a TTable, but the TTable has a
calc field that has a statement similar to...
if tblAType.AsString = 'P' AND tblAFee.IsNull then
 tblADisplayCalc.AsString := 'Payment'
else tblADisplayCalc.AsString := tblAFee.AsString;

How would I do that in SQL? Any tips would be appreciated.

Regards & TIA

 

Re:conditional statement in SQL calc field


Quote
>I would like to use a TQuery to replace a TTable, but the TTable has a
>calc field that has a statement similar to...
>if tblAType.AsString = 'P' AND tblAFee.IsNull then
> tblADisplayCalc.AsString := 'Payment'
>else tblADisplayCalc.AsString := tblAFee.AsString;

>How would I do that in SQL? Any tips would be appreciated.

Your only choice creating this field in Local SQL would be to combine two
queries using a UNION clause.
However a query can have a calculated field too and that makes the most sense

--
Brian Bushay (TeamB)
Bbus...@NMPLS.com

Other Threads