# Thread: Report group by fortnight (2000)

1. ## Report group by fortnight (2000)

Just a quick question about grouping in a report. It's easy to group on a date field by week or month, but is there an easy way to groupby fortnight?
Thanks
Peter

2. ## Re: Report group by fortnight (2000)

Enter a calculated expression in the Field/Expression box in the Sorting and Grouping window:

=[DateField] 14

where DateField is the name of the relevant date field.

3. ## Re: Report group by fortnight (2000)

Thanks. Nice use of the integer division operator.

4. ## Re: Report group by fortnight (2000) - Side note

Just as a side note, I got myself into trouble with this one, as I (incorrectly) guessed the order of precedence of the integer division operator.
I'd guessed that it would be the same as normal division (and therefore multiplication). So in a more complex operation, I got stuffed.
As an example, I thought:
? 2410*10
would give me 20, but it actually gives Int(24 / (10*10)), equals 0.
Caveat for new players.
See http://safari.oreilly.com/9780789736673/ch04lev1sec3 and http://msdn.microsoft.com/archive/default....1/D6/S5B27E.asp
Peter

5. ## Re: Report group by fortnight (2000) - Side note

Good point. It's also mentioned in the VBA help - search for operator precedence.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•