
November 13th, 2012, 04:10 PM
|
|
Registered User
|
|
Join Date: Oct 2012
Posts: 4
Time spent in forums: 26 m 46 sec
Reputation Power: 0
|
|
|
Help with Aggregated SQL Statement (similar to a crosstab?)
Hi. I've been banging my head against this for a while so I thought I may ask for help.
In its simplest form, a table has 2 columns. One is date / time, the other is a rating of 0-10.
What I am trying to accomplish is aggregating the data for use in a graph. I want to re-render the data to be:
Columns:
In the month column, I believe I should use MONTH(DateColumn) and some variation of an If or CASE statement (would like to store as "August", September", etc...). In each new ranking column, I want a simple tally. Thus, If a response a "3" is provided 72 times when the MONTH(DateColumn) = 8 (aka August), in the row where August is listed as the Month, I would like 72 listed in column '3'.
Does this make sense?
I'm studying up on if/then's and case statements but this level of conditional select logic is quite new to me.
Thank you for any help.
-MM
|