How to

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am attempting to collects data from a table and tally totals based upon
month/yr that its datestamp is. What I need to do is somehow extract the
data for a certain month, say December, and total each months count for year
over year comparison. It might look like this:

Dec2003 Dec2004 Dec2005 Total
15 20 51 86

I understand that I need to do a cross-tab, but the syntax to only get the
month/yr I want is the problem. Any ideas? I will be extremely grateful.
 
How about something like

SELECT Year(DateStamp) As YearDS, Month(DateStamp) As MonthDS, Count
(Some_Variable) As CountOfVar FROM YourTableName WHERE Month(DateStamp) =
[Enter A Month 1-12] GROUP BY Year(DateStamp), Month(DateStamp);

HTH
 
Back
Top