Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Newbie Question
Message
From
28/02/2006 15:42:23
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
SQL Newbie Question
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Miscellaneous
Thread ID:
01100105
Message ID:
01100105
Views:
56
I need to create a query that will provide 12 months of data that can be dropped into a spreadsheet via _vfp.dataclip(,,3) function. The results should look something like:

JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC
ITEM1 12 13 9 12 6 21 13 15 12 16 9 12
ITEM2 9 10 10 14 10 17 15 16 17 17 12 18
ITEM3 11 17 16 16 16 23 12 14 16 18 20 17
ETC ..

The only way I know to acquire this data is to run a SQL query with a monthly date range 12 times. I know there must be a way to write a single SQL statement that would pull all of this data at once but I'm not sure how to construct it.

Anyone available to give me an example of how to do this?

Thanks,
Robert Wright
Next
Reply
Map
View

Click here to load this message in the networking platform