Print Page | Close Window

Grouping days of the week

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=22069
Printed Date: 28 Mar 2024 at 12:13pm


Topic: Grouping days of the week
Posted By: Joe FL
Subject: Grouping days of the week
Date Posted: 25 Aug 2016 at 8:57am
I am trying to group days of the week i.e.
1st to 5th
6th to 10th
11th to 15th
16th to 20th
21st to 25th
26th to 31st

Is there an easy way to do this?



Replies:
Posted By: kevlray
Date Posted: 26 Aug 2016 at 5:12am
You could make a formula with an if statement something like this

if day({somefield}) >= 1 and day({somefield}) <=5 then '1st to 5th'
else if day({somefield}) >= 1 and day({somefield}) <=5 then '6th to 10th'
 etc.

Then use that formula to group on.  You could also use a switch statement which might be easier to read in the long run.


Posted By: Joe FL
Date Posted: 26 Aug 2016 at 5:23am
Thank you! This will work   



Print Page | Close Window