General information
Category:
Coding, syntax & commands
>This can be done in a single command, more or less like this:
>select ItemName,;
> sum(iif(month(DateField) = 1, ValueField, $0)) as Jan,;
> sum(iif(month(DateField) = 2, ValueField, $0)) as Feb,;
> ...
Thanks Hilmar,
I'm using VFP to connect to an SQL database via ODBC so I can't use the IIF() because it's not understood by the ODBC connect. Ultimately, once I figure out how to write this SQL (that's compatible with MSQ 6.5), I then need to move it to Excel & MS Query to pull the data directly into the spreadsheet. The people that need this data don't have a copy of VFP and I don't want to get involved in creating and distributing EXE's.
Thanks,
Robert
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