Grouping on date field

  • Thread starter Thread starter Steve J
  • Start date Start date
S

Steve J

Hi

In a query i group a date field by "yyyymm" and run a count, which works. I
need to achieve one more goal when i run the report.

For the current year (which for us starts in August) I want to display the
Count value for each month. However for periods earlier than the previous
August, I would ideally like to display the Count value on a quarterly
basis, otherwise I will have too many rows on the report.

Is this possible?

thanks
S
 
You could try set your sorting and grouping expression to
=IIf([DateField]<#8/1/2004#, Format([DateField],"yyyyq"),"Z" &
Format([DateField],"yyyymm"))

I added the "Z" to make sure the records report in the proper chronological
order.

You should be able to replace the "hard-coded" 8/1/2004 with an expression
that is the "previous August".
 
Back
Top