Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Calc Same Week of Year Before Post Reply Post New Topic
Author Message
pbee
Newbie
Newbie


Joined: 18 Aug 2011
Online Status: Offline
Posts: 3
Quote pbee Replybullet Topic: Calc Same Week of Year Before
     Posted: 18 Aug 2011 at 6:25am
Hi
 
I'm using CR version 9. Based on the curent date at the time of running the report, using a formula I would like to calculate the date for the Monday of the equivalent week to the current week a year ago.

For example using Thursday 18th August 2011, I would want it come up with Monday 16th August 2010.
 
Thanks for any help.


Edited by pbee - 18 Aug 2011 at 6:27am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 18 Aug 2011 at 7:13am
maybe this but not sure about if currentdate is a monday...
dateserial(year(currentdate)-1,month(currentdate),day(currentdate)-(dayofweek(dateadd('yyyy',-1,currentdate),crtuesday)))
IP IP Logged
pbee
Newbie
Newbie


Joined: 18 Aug 2011
Online Status: Offline
Posts: 3
Quote pbee Replybullet Posted: 18 Aug 2011 at 9:01pm
Thanks for this, I will give it a try.
IP IP Logged
pbee
Newbie
Newbie


Joined: 18 Aug 2011
Online Status: Offline
Posts: 3
Quote pbee Replybullet Posted: 18 Aug 2011 at 10:16pm
Just tried this and it works great for what I want. Thanks for your help.
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