Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement