Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: last record for each month Post Reply Post New Topic
Author Message
seagull
Newbie
Newbie


Joined: 02 Aug 2009
Location: Saudi Arabia
Online Status: Offline
Posts: 7
Quote seagull Replybullet Topic: last record for each month
     Posted: 13 Oct 2009 at 2:53am
hi,
 
 I need to get the last recoded record for each month
 
for example:
 
 jan:
 
 record1 01/01/2009
 record2 17/01/2009
 
feb:
 
 record1 07/02/2009
 record2 30/02/2009
 
 
I need the result be :
 
record2 17/01/2009
record2 30/02/2009
 
 
please help me
 
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 13 Oct 2009 at 6:19am
create a formula that returns the mm-date, then group by the formula, display date in the group footer.  suppress the details, this will give you the last record of each month.
IP IP Logged
seagull
Newbie
Newbie


Joined: 02 Aug 2009
Location: Saudi Arabia
Online Status: Offline
Posts: 7
Quote seagull Replybullet Posted: 14 Oct 2009 at 12:07am
what do you mean by mm-date, do you mean just change the format?
 
I could not find a function take the date and returns the mm-date.
 
if you mean change the format, it does not work with me :(
 
please advice
 
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 14 Oct 2009 at 6:14am

totext({table.field},"MM")+"-"+totext({table.field}, "MM/dd/yyyy")

for 5/25/09 this would return 05-05/25/2009.  You can then group by the first 2 digits and sort by the entire field, then look at the last entry, and it will be the last record in the month.
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