Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Conditionally counting in SQL
Message
De
08/05/2005 15:59:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
08/05/2005 14:24:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows '98
Network:
Windows 98
Database:
Visual FoxPro
Divers
Thread ID:
01012011
Message ID:
01012037
Vues:
23
When you specify several fields, you need a comma (,) after each field, except the last.

Also: To analyze a complex SQL command that doesn't work, try starting simple, and adding one small piece at a time. Compile, and if there are no error messages, add the next piece. That way, you have a good chance to find the culprit.

>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
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform