Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Code This VFP IIF Statement In SQL
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01326128
Message ID:
01326136
Views:
14
>The problem now is that SQL doesn't seem to like the 'AND' in the second CASE line.
>
>CASE 
>	WHEN tr.sTrans_Type_CD ='PR' THEN tr.decTrans_Qty
>	WHEN (tr.sTrans_Type_CD='PT' AND tr.decTrans_Qty > 0) THEN tr.decTrans_Qty
>	ELSE 0
>END AS Receipt
>
>
>"Incorrect syntax near the keyword 'AND'."
>

See changes inline. Use the second form of CASE statement.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform