Re: Sort by Month
From: Douglas J. Steele (NOSPAM_djsteele_at_NOSPAM_canada.com)
Date: 08/20/04
- Next message: Gary Walter: "Re: Query Building"
- Previous message: Roger Carlson: "Re: DatePart or multi parameter functions return invalid comma error"
- In reply to: Andrew Wilkins: "Sort by Month"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 20 Aug 2004 09:10:53 -0400
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.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no e-mails, please!) "Andrew Wilkins" <AndrewWilkins@discussions.microsoft.com> wrote in message news:490CEE33-B222-4E98-95F1-77CFE23C729F@microsoft.com... > 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!
- Next message: Gary Walter: "Re: Query Building"
- Previous message: Roger Carlson: "Re: DatePart or multi parameter functions return invalid comma error"
- In reply to: Andrew Wilkins: "Sort by Month"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|