Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Report Design
Message Icon Topic: YearToDate Post Reply Post New Topic
Author Message
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Topic: YearToDate
    Posted: 20 Oct 2011 at 11:46am
I would like to create a formula to have SYSDATE or YTD minus 3 years. I created a function for MONTHS:
 
MONTHNAME(Month({ORD1.CREATED_DATETIME}),true)
 
and then created another formula where I subtracted 36 from MONTHS:
 
TONUMBER({@MONTHS}) - 36
 
And this didn't work. Any suggestion would be greatly appreciated.
 
CoachGBT
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Oct 2011 at 12:07pm
table.date in dateserial(year(currentdate)-3,1,1) to dateadd('yyyy',-3,currentdate)
IP IP Logged
CoachGBT
Newbie
Newbie


Joined: 08 Apr 2011
Online Status: Offline
Posts: 29
Quote CoachGBT Replybullet Posted: 21 Oct 2011 at 3:25am

It worked. Thank You!

Now as an added bonus; is it possible to do do the same from SYSDATE? SYSDATE minus 3 years. Have a daily running of 3 years from today's date.
 
CoachGBT
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 21 Oct 2011 at 3:29am
Not sure what your sys date is but theoretically you should be able to just replace sysdate where current date is in the formula
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.015 seconds.