Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-02-01 : 23:33:34
|
Craig writes "I want to turn an Access 97 query into a pass through query and send it to SQL Server 7.
The query is:
INSERT INTO EFTsummary ( shop, trandate, eftdata ) SELECT shop, trandate, Sum(IIf([type]=0,[amount],0-[amount])) AS eftdata FROM EFTDETAILS GROUP BY shop, trandate
As there is no IIF() function in SQL Server 7 how do I code the query in transact SQL.
I know that you can use the CASE statement to return various textual values in a result set, but I actually want to do some calculations on one field dependant on another.
Please help this is causing me a real headache.
Regards, Craig Handley" |
|
|
|
|
|