SqlCoderGirl
Programmer
I'm providing a user with a report on accounts with activity by month for the previous 6 months. By pulling the month out of the activity date, I want to use it in the column headers.
For example, if I kick off the query on 8/4, the results should be similar to
ID February March April May June July
xxx 12345 254 4521 4521 541 4587
The headers change dynamically, depending on when the query is run. I'm trying to use datename(month, activitydate) to pull in the month name, but can't figure out how to get it into the header.
Any suggestions???
For example, if I kick off the query on 8/4, the results should be similar to
ID February March April May June July
xxx 12345 254 4521 4521 541 4587
The headers change dynamically, depending on when the query is run. I'm trying to use datename(month, activitydate) to pull in the month name, but can't figure out how to get it into the header.
Any suggestions???