Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to count records with IIF condition
Message
From
22/02/2007 09:50:51
Rasheed Al Rasheed
Riyadh Armed Forces Hospital
Riyadh, Saudi Arabia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to count records with IIF condition
Miscellaneous
Thread ID:
01197932
Message ID:
01197932
Views:
57
Hi All

I need to count records meeting a cerain criteria in a select statement. I constructed the following code
Select  A.Code, Count(Iif(A.SB="B", a.code,000000000)) As sbbtm, ;
			count(Iif(A.SB="S", A.code,000000000)) As sbstm;
			FROM M_070219 A ;
			where !EMPTY(A.CODE) ;
			ORDER By  A.Code ;
			group By  A.Code ;
			INTO Cursor cSb_1 Readwrite
In the case I get the same count for A.SB = "B" and A.SB="S" where infact they shoud have different counts.

Any respone is appreciated.

Rasheed
Next
Reply
Map
View

Click here to load this message in the networking platform