Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: End Month Date Post Reply Post New Topic
Author Message
dagz200
Newbie
Newbie


Joined: 06 Aug 2012
Online Status: Offline
Posts: 2
Quote dagz200 Replybullet Topic: End Month Date
     Posted: 06 Aug 2012 at 3:54pm
I'm trying to figure out a formula that would give me the end date for what ever the field month and year it comes up with to report the end of the date for the month. Example 7/12/2012 to say 7/31/2012. So I used the below formula.

DateAdd ("m", 1, DateTime( Year({table.End_of_date}),
Month({table.End_of_date}), 1, 0,0,0)) - 1

but also trying to use this with it

IF totext ({table.End_of_date}) <> " "
then totext ({table.End_of_date},"MMddyyyy")
else totext ("        ")

I tried to the best of my knowledge to put work this out but keep getting boolean errors. Any help is greatly appreciated.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 07 Aug 2012 at 4:23am
if it is the current month
dateserial(year(currentdate),month(currentdate)+1,1-1)
 
if you want it based on a param or another field replace curretndaet with that item.
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