Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Only show last 5 years of data Post Reply Post New Topic
Author Message
TLG2005
Newbie
Newbie
Avatar

Joined: 10 Nov 2009
Location: United States
Online Status: Offline
Posts: 1
Quote TLG2005 Replybullet Topic: Only show last 5 years of data
     Posted: 10 Nov 2009 at 1:18pm

I need to show the last 5 years of giving history.

Is there a formula that allows the report to show the last 5 years without specifying the dates?
 
in other words, i want it to be dynamic so in January of each year I don't have to go change my date ranges, etc.
 
Thanks!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Nov 2009 at 1:37pm

NOt sure which you mean...

5 years ago from today (e.g. >11/10/2004)
{Table.datefield} >= dateadd('yyyy',-5, currentdate)
 
or >Jan 1 of four years ago (e.g. > 01/01/2005)?
{table.field} >= date(year(dateadd('yyyy',-4, currentdate)),01,01)
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