Tips and Tricks
 Crystal Reports Forum : Crystal Reports .NET 2003 : Tips and Tricks
Message Icon Topic: Grouping days of the week Post Reply Post New Topic
Author Message
Joe FL
Newbie
Newbie


Joined: 15 Aug 2016
Online Status: Offline
Posts: 2
Quote Joe FL Replybullet Topic: Grouping days of the week
    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?
IP IP Logged
kevlray
Admin Group
Admin Group
Avatar

Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Quote kevlray Replybullet 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.
IP IP Logged
Joe FL
Newbie
Newbie


Joined: 15 Aug 2016
Online Status: Offline
Posts: 2
Quote Joe FL Replybullet Posted: 26 Aug 2016 at 5:23am
Thank you! This will work   
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.047 seconds.