grouping quarters

F

fishqqq

HI can someone please tell me how to create a query that will group
the record [date] by calendar months & quarters ?

i will have the the [date] field in the query but i would like the
select query calculate how many records there were in each month of
the year. and also each quarter of the year.

Is this possible?

tks in advance
 
J

John W. Vinson

HI can someone please tell me how to create a query that will group
the record [date] by calendar months & quarters ?

i will have the the [date] field in the query but i would like the
select query calculate how many records there were in each month of
the year. and also each quarter of the year.

Is this possible?

tks in advance

It's simpler to use two queries, but you certainly can group by them; for
instance, you can use the builtin Month([date]) function to extract the month
number (1-12) and group by it, and/or use

Q: Format([date], "q")

to extract the quarter 1-4.

In a Report, you can include both fields, and use the sorting and grouping
dialog of the Report to create separate levels of group headers and footers.
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 
F

fishqqq

HI can someone please tell me how to create a query that will group
the record [date] by calendar  months & quarters ?
i will have the  the [date] field in the query but i would like the
select query calculate how many records there were in each month of
the year. and also each quarter of the year.
Is this possible?
tks in advance

It's simpler to use two queries, but you certainly can group by them; for
instance, you can use the builtin Month([date]) function to extract the month
number (1-12) and group by it, and/or use

Q: Format([date], "q")

to extract the quarter 1-4.

In a Report, you can include both fields, and use the sorting and grouping
dialog of the Report to create separate levels of group headers and footers.
--

             John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:http://social.msdn.microsoft.com/Fo...al.answers.microsoft.com/Forums/en-US/addbuz/
and see alsohttp://www.utteraccess.com

This works well except it doesn't differentiate Q1 2009 from Q! 2010 -
is there a way to have the field separate like this?

tks
 
J

John W. Vinson

This works well except it doesn't differentiate Q1 2009 from Q! 2010 -
is there a way to have the field separate like this?

tks

Sure; just include the year in the format:

Format([date], "\Qq yyyy")

You'll want to sort by [date] not by this formatted expression (otherwise it
will sort all the Q1's before the Q2's)
--

John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also http://www.utteraccess.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top