Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Group By Week that start in the Monday Post Reply Post New Topic
Author Message
JohnyMoraes
Newbie
Newbie


Joined: 17 Mar 2011
Online Status: Offline
Posts: 6
Quote JohnyMoraes Replybullet Topic: Group By Week that start in the Monday
     Posted: 14 Feb 2012 at 7:15am
I need to do a report separated for weeks. I create a Group for the date, in crescent order for every week.
But the Crystal assumes the weeks start in the Sunday, but i need that it start in the Mondays...It´s possible ?

Thanks for the Helps!
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 14 Feb 2012 at 9:36am
you could do it manually like
 if table.date in date(monday) to date(sunday) then "week 1" else
...

IP IP Logged
JohnyMoraes
Newbie
Newbie


Joined: 17 Mar 2011
Online Status: Offline
Posts: 6
Quote JohnyMoraes Replybullet Posted: 15 Feb 2012 at 2:59am
Originally posted by kostya1122

you could do it manually like
 if table.date in date(monday) to date(sunday) then "week 1" else
...



But in this case, if i search an interval of 1 year, i have to write conditions for every weeks in the year...The crystal automaticaly grops for weeks, but the week begin in Sunday...I just need to change the begin to monday.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 15 Feb 2012 at 3:54am

I do not know how to make the default date grouping use a different day of the week to as the start.

A few thoughts as other solutions...
Use datepart('ww',datefield,crmonday) to extract your week value based on your crmonday need and extract the year then add these togther in a text string to use as grouping.
or
maybe just subtract 1 day from your date field dateadd('d',-1,datefield) and group on that instead of your db date field.
IP IP Logged
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