A week or two ago, some kind soul here helped me put together a query to tabulate the total number of posts and replies from a snitz forums database. Here's the query:SELECT A.Year, A.Week, Count(*) Posts FROM (SELECT datepart(year,datetime) Year, datepart(wk,datetime) Week FROM snitz_topics UNION ALL SELECT datepart(year,datetime) Year, datepart(wk,datetime) Week FROM snitz_reply) AS A GROUP BY A.Year, A.Week ORDER BY A.Year, A.Week
This yeilds results like:Year Week Posts---- ---- ----2001 52 4002002 1 6002002 2 7002002 3 800
However, that's tough to graph. Can anyone think of a clever way to convert the Year/Week columns into a single datetime column that represents "Week of...". IE:Date Posts------------ -----12/26/2001 4001/2/2002 6001/9/2002 7001/16/2002 800
...Thanks in advance-b