Grouping data by quarter

A

Attila Fust

I want to group my data based on quarter - not calendar
quarter but based on the first month of data. For
example, if my data starts Aug1 I want my quarters to be
the following:

Aug1-Oct31, Nov1-Jan31, Feb1-Apr30, May1-Jul31

Example data as follows:

Date Sales
08/01/03 1000.00
08/15/03 1000.00
09/15/03 10000.00
10/11/03 9500.00
10/31/03 8500.00
-
-
-
01/01/04 9000.00

So in my query I would want to show the sum of sales from
08/01-10/31 as the first quarter.

Does anyone have an example.

Regards,

Attila
 
M

Michel Walsh

Hi,



group by on a computed expression, like:

GROUP BY DatePart("q", DateAdd("m", -7, MyDateField) )




Hoping it may help,
Vanderghast, Access MVP
 

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