Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SUM not working in report field
Message
De
01/12/2005 08:00:17
 
 
À
01/12/2005 07:18:02
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01073187
Message ID:
01073649
Vues:
17
Thank you Hilmar.
The error in my code above was just the way I typed it here. It was right in my actual code.
I think we are getting closer. This is my actual SQL statement:

SELECT ALL codigo,IIF(MONTH(fecha)=1,cantidad,$0),;
IIF(MONTH(fecha)=2,cantidad,$0),;
IIF(MONTH(fecha)=3,cantidad,$0),;
IIF(MONTH(fecha)=4,cantidad,$0),;
IIF(MONTH(fecha)=5,cantidad,$0),;
IIF(MONTH(fecha)=6,cantidad,$0),;
IIF(MONTH(fecha)=7,cantidad,$0),;
IIF(MONTH(fecha)=8,cantidad,$0),;
IIF(MONTH(fecha)=9,cantidad,$0),;
IIF(MONTH(fecha)=10,cantidad,$0),;
IIF(MONTH(fecha)=11,cantidad,$0),;
IIF(MONTH(fecha)=12,cantidad,$0)FROM ventasxmes GROUP BY codigo INTO CURSOR xvenxmes

REPORT FORM ventasmensual PREVIEW

In the report I have 12 'cantidad' fields, each with a 'Print when month(fecha)=1' (one for each month) condition. It works ok. Only problem is that if a given product had, say, sales in 3 different months, it shows each month in a separate line, instead of putting all the sales under its respective month column in a single line. (Hope this makes sense) :)
How can we solve this?
Mil Gracias.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform