General information
Forum:
Microsoft SQL Server
Title:
IIF functionality in a Select Statement
I have the folling select statment operating in the odbc to fox world.
I need to do the same thing with oledb to SQL tables now. I cannot find the correct syntax. Any suggestions?
SELECT
sum(iif(ordh.rebid_cost>0,ordh.rebid_cost,ordh.bid_cost)) as tot_bid_cost
FROM ordh left join ordd on ordh.co_number=ordd.co_number
GROUP by ordd.prom_dlvry
I understand that I should be using a case statement instead of IIF....but how do you do a sum with a case statement?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only