Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question about porting IIF() to SQL Server
Message
From
06/10/2001 22:08:28
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Question about porting IIF() to SQL Server
Miscellaneous
Thread ID:
00565233
Message ID:
00565233
Views:
57
Question...

I'm porting some VFP queries into SQL server, and have a question about embedding IIF() functions...

I have a VFP query where I'm summing certain fields based on an Invoice type. In VFP, I do the following

SELECT , SUM(IIF(InvType='01',Qty * UnitPrice,0)) AS TotDollars...

What is the best way to do this in Transact-SQL? The only thing I've come across that would seem to work is a SELECT CASE statement in the query, though my question is how much this would affect performance when working on a large file.

Thanks,
Kevin
Next
Reply
Map
View

Click here to load this message in the networking platform