Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: LastFullMonth in combination with the the DateAdd Post Reply Post New Topic
Author Message
keithrichards
Newbie
Newbie


Joined: 30 Jun 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote keithrichards Replybullet Topic: LastFullMonth in combination with the the DateAdd
     Posted: 20 Jul 2010 at 12:32pm
Hi there,
 
I was wondering if anyone can assist with a syntax that will select data from the last full month less twelve months.
 
So in current terms that would represent 01/06/2010 - 30/06/2010 less twelve months. This would deliver a final result of data in the range of 01/06/2009 - 30/06/2009.
 
Obviously its easy to draw the data using parameters, but due to the nature of my report I can't use this method.
 
Is it possible to use LastFullMonth in combination with the the DateAdd or DateDiff function. That way I could say give me the last full month less 12 months??
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Jul 2010 at 1:04pm
use dateserial here as it is probably easier,
Not at my machine but I think this is what you want.
date field in dateserial(year(currentdate),month(currentdate)-13,1) to dateserial(year(currentdate),month(currentdate)-12,1-1)
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 20 Jul 2010 at 1:06pm
there also may be an actual command for this buut I cannot remember...
lastyearLastFullMonth?
Check help under LastFullMonth and see if there are any links for it
IP IP Logged
keithrichards
Newbie
Newbie


Joined: 30 Jun 2010
Location: Australia
Online Status: Offline
Posts: 31
Quote keithrichards Replybullet Posted: 21 Jul 2010 at 12:55am
AWESOME!!!
 
Exactly what I needed to finish the report.... I can't thank you enough.
 
D Blank and Crystal Reports Book are the best! Smile
 
FYI - I used your first dateSerial suggestion.
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