View Full Version : Grouping by Date Ranges


Graham T
01-30-2002, 06:32 AM
I have a query that uses the DateDiff function to calculate the number of days taken to make payment:

DaysToPay: DateDiff("d",[dtmTransactionDate],[dtmPaymentDate]).

What I would now like to do is create a report grouping payment times. The groups that are required are as follows:

Upto 14 days,
15 to 20 days,
21 to 60 days,
60 + days.

Is it possible to create these groups directly on the report using an expression or would the grouping need to be applied in the query.

Thanks in advance

Graham

Pat Hartman
01-30-2002, 08:07 AM
Since they are not standard calendar groupings - days, weeks, months, years - you will need to create the groups in the query. Use the IIf() function to create them.

Graham T
01-30-2002, 09:00 AM
Pat

I thought that maybe the answer.

Would the case be that I would need to create a new field for each expression all in one query, and then flag them up somehow for the report to group them?

Graham