Sort by Month

A

Andrew Wilkins

I have a few thousand records that all contain a date field in the British
format of dd/mm/yy. I want to create query that groups the records into
months. So, all records that have 01 as the month go in the January column,
and so on. How do I do this?

Thanks!
 
D

Douglas J. Steele

Add a computed field to your query, and sort by it. If all you want is by
month (so that January 2001 and January 2004 would get sorted together), use
Month([MyDateField]) as the computed field. If you want to sort by year and
month, use Format([MyDateField], "yyyymm"), or add two computed field
Year([MyDateField]) and Month([MyDateField]), and sort on both.

Replace MyDateField with the appropriate field name.
 
Top