Originally Posted by
jzwp11
If you want your report to extract detail records by month, you would set up your query as follows
SELECT month(datefield) as period, other fields...
FROM tablename
Then in your report you would set up a group level using the period field. Now, if your data spans more than one year & you want the report to include more than one year, then you will have to use the year() function in the query above and include an additional group level in your report. If you want the data for only 1 year, you will need to filter the above query for the year again using the year() function but using it in the WHERE clause of the query.
If you want to do counts, you can do that in the period group level of the report.
If you want to do the counting in the query directly rather than in the report, you would need an aggregate query based on the query shown above
SELECT period, Count(somefield)
FROM queryabove
GROUP BY Period