Hi There,
I feel this must be a common problem yet I can't find much about it here or Google.
I would like to chart some information based on a date field. Basically I want a running total per month. It's a chart of 'assessments'. X is the month, Y is the value. I have extracted the month values using DatePart. I have two questions:
First some SQL:
1. How do I re-associate the year with the month? At the moment I have a year and a month column, but I want to make sure that Jan 2004 is not confused with Jan 2005.
2. How do I display the month name rather than the month value? So instead of 1 I want 'January'.
Experience tells me that there will be a pretty simple solution to this - I just can't find it. Please help.
I feel this must be a common problem yet I can't find much about it here or Google.
I would like to chart some information based on a date field. Basically I want a running total per month. It's a chart of 'assessments'. X is the month, Y is the value. I have extracted the month values using DatePart. I have two questions:
First some SQL:
Code:
SELECT DatePart("yyyy",[qrySCSCADReview]![txtDate]) AS [Year], DatePart("m",[qrySCSCADReview]![txtDate]) AS [Month], Count(DatePart("m",[qrySCSCADReview]![txtDate])) AS MonthCount
FROM qrySCSCADReview
GROUP BY DatePart("yyyy",[qrySCSCADReview]![txtDate]), DatePart("m",[qrySCSCADReview]![txtDate])
HAVING (((DatePart("yyyy",[qrySCSCADReview]![txtDate])) Is Not Null) AND ((DatePart("m",[qrySCSCADReview]![txtDate])) Is Not Null))
ORDER BY DatePart("yyyy",[qrySCSCADReview]![txtDate]), DatePart("m",[qrySCSCADReview]![txtDate]);
1. How do I re-associate the year with the month? At the moment I have a year and a month column, but I want to make sure that Jan 2004 is not confused with Jan 2005.
2. How do I display the month name rather than the month value? So instead of 1 I want 'January'.
Experience tells me that there will be a pretty simple solution to this - I just can't find it. Please help.