Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conditionally counting in SQL
Message
From
08/05/2005 14:34:03
 
 
To
08/05/2005 14:24:32
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01012011
Message ID:
01012029
Views:
18
Try relative grouping such as GROUP BY 3,1,2 and ORDER BY 3,1,2. Under VFP 8 and higher I think you need to group by all non aggregate columns. Since nmonth and cmonth are functions of one and other, that causes no problem here. Give it a shot...
>Dear Sir,
>
>I added "," between sums according to your advise as follows
>
>SELECT MONTH(date) as nmonth,;
>	CMONTH(date) as cmonth,;
>	YEAR(date) as nyear;
>	sum(weight) as weight;
>	sum(iif(mode="L",weight,1,0)) as bagsLC, ;
>	sum(iif(mode="b",weight,1,0)) as bagsLS;
>	from avlbook;
>	GROUP BY nmonth,nyear ;
>	ORDER BY nyear,nmonth;
>	INTO CURSOR Temp
>
>But the problem is still exists as
>
>Command contains unrecognized command/phrase...
>
>Please modify my codes again
>
>Thnaks
Previous
Reply
Map
View

Click here to load this message in the networking platform