General information
Category:
Coding, syntax & commands
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.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only