Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IIF in Select
Message
From
24/11/1998 15:36:54
 
 
To
24/11/1998 14:42:14
Carl Sarazin
Statistics Canada
Ottawa, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00161059
Message ID:
00161092
Views:
22
>SELECT sum(IIF(rrspcont = 0,1,0)) as rrsp0,
> sum(IIF(rrspcont = 1,1,0)) as rrsp1, and so fourth
>FROM...
>
>Can I group the IIF in another IIF and still keep the same results?
>(sum(IIF(rrspcont = 0,1, IIF(...) without changing the variable
>name to store the result?
>
>Does anyone know if this is possible?

You expression defines what value should be in the column. If you nest the IIF() you'll get one column but it will only contain the total for all the possible values.

Do you want multiple rows? Would this work?

SELECT rrspcont, COUNT(*) FROM x GROUP BY rrspcont

This would give you the number of time a specific value was repeated in the table.

HTH

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform