Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sum iif()
Message
 
To
07/11/2005 04:34:38
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 6 SP3
OS:
Windows '95
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01065901
Message ID:
01065911
Views:
15
You are right. I just copy and paste Tariq's code w/o counting parantheses:o(

>>>Dear Experts
>>>
>>>
>>>SELECT AVLBOOK
>>>SUM For Mode='B' BAGS To B
>>>SUM For Mode='L' BAGS To L
>>>
>>>I want to use above lines in SELECT statement
>>>I wrote follwing lines but do not work please modify
>>>
>>>SELECT *;
>>>	FORM AVLBOOK;
>>>	SUM(IIF(BAGS,Mode="B",1,0)AS B;
>>>	SUM(IIF(BAGS,Mode="L",1,0)AS L;
>>>	ORDER BY ACC_NO;
>>>	GROUP BY ACC_NO;
>>>	INTO CURSOR XYZ
>>>
>>>Field Bags is numeric
>>>Filed Mode is character
>>>
>>>please help
>>
>>SELECT *,;
>>	SUM(IIF(Mode="B",BAGS,0)AS B,;
>>	SUM(IIF(Mode="L",BAGS,0)AS L;
>>	FORM AVLBOOK;
>>	ORDER BY ACC_NO;
>>	GROUP BY ACC_NO;
>>	INTO CURSOR XYZ
>
>Hi Borislav,
>
>you missed a few ending parantheses, and also B is dangerous as a field name, since it also indicates work area 2.<pre>
>SELECT *,;
>	SUM(IIF(Mode="B",BAGS,0)) AS B1,;
>	SUM(IIF(Mode="L",BAGS,0)) AS L1;
>	FORM AVLBOOK;
>	ORDER BY ACC_NO;
>	GROUP BY ACC_NO;
>	INTO CURSOR XYZ
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform