View Single Post
  #3   Report Post  
Ron Coderre
 
Posts: n/a
Default

As I keep forgetting, MS Query will also build the query for you if you:
Set it to return Grouped Values (ViewQuery PropertiesGroup Records).
Add a column and set it to Count (RecordsAdd Column).

The resulting SQL code will resemble this:
SELECT
FORMAT(Date_LU.RefDate,'YYYYMM') AS 'YrMth',
Count(*) AS 'Periodcount'
FROM `C:\CoderreR\Finances\Cash_Analysis_2005_db`.Date_ LU Date_LU
GROUP BY FORMAT(Date_LU.RefDate,'YYYYMM')
HAVING (FORMAT(Date_LU.RefDate,'YYYYMM') Between '200501' And '200505')

--
Regards,
Ron