By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

"Group by" annually

P: n/a
How can I use "Group By" or a formula to group my query results in
1-year periods from a given date, e.g. 3 groups:
1 Sept 2001 - 1 Sept 2002
1 Sept 2002 - 1 Sept 2003
1 Sept 2003 - 1 Sept 2004

Thanks,

Mark

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
In the Field row of your query, enter:
FinYear: Year(DateAdd("m", -8, [DateField]))
replacing "DateField" with the name of your date field.
This returns 2001 for all dates between 1 Sep 2001 and 31 Aug 2002.

You can now Group By this calculated field.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"mark" <ma****************@bloglines.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
How can I use "Group By" or a formula to group my query results in
1-year periods from a given date, e.g. 3 groups:
1 Sept 2001 - 1 Sept 2002
1 Sept 2002 - 1 Sept 2003
1 Sept 2003 - 1 Sept 2004

Thanks,

Mark

Nov 13 '05 #2

P: n/a
Thanks, Allen. For those others who might want to know, I added one
enhancement & here's what I ended up with:
Year(DateAdd("m",(-1)*DatePart("m",[DateField]),[DateField]))

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.