Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Displaying dates Post Reply Post New Topic
Author Message
HelenH
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote HelenH Replybullet Topic: Displaying dates
     Posted: 21 Apr 2010 at 2:53am
I am using the LastFullMonth parameter to select data fro my report.
 
I want to be able to display the last date of the month in question in  the report header, but don't know how to.
 
Can any one help me.Confused
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 21 Apr 2010 at 3:28am
the usual trick is to find the first day of the next month, and then subtract 1.
 
local datevar firstDay := date(YEAR({table.field}), Month({table.field})+1, 1);
firstDay := DATEADD("d", -1, firstDay)
//then format as you want.
 
 
HTH
IP IP Logged
HelenH
Newbie
Newbie
Avatar

Joined: 21 Apr 2010
Location: United Kingdom
Online Status: Offline
Posts: 9
Quote HelenH Replybullet Posted: 21 Apr 2010 at 4:12am
Star  Thanks for that.
 
I did it slightly differently, but have got the result I wanted.  Clap
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