Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Month - 1 Post Reply Post New Topic
Author Message
James Rader
Newbie
Newbie
Avatar

Joined: 14 Jan 2011
Online Status: Offline
Posts: 9
Quote James Rader Replybullet Topic: Month - 1
    Posted: 14 Jan 2011 at 12:56pm
I am a newbie, so bear with me.
 
I am trying to set a date starting the 25th of every month, which is the start of our billing cycle.
 
Works well by using
 
Date (Year (CurrentDate),(Month (CurrentDate)-1) ,25 )
 
except when the month is January. How can I work around this?
Jim
IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 18 Jan 2011 at 8:21am
Try this:
 
If Month(CurrentDate) = 1 then
  Date((Year(Currentdate) - 1), 12, 25)
else
  Date(Year(CurrentDate),(Month (CurrentDate)-1) ,25 )
 
-Dell 
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.031 seconds.