Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Last Full Year

Status
Not open for further replies.

krpurcel

IS-IT--Management
Dec 1, 2003
77
US

LastFullWeek and LastFullMonth exist, but there is no LastFullYear? I'm sure there must be a solution for this - getting last year's data for comparisons is certainly a routine operation that happens often - but I haven't found one.

I don't want LastYearYTD. I need all the data for last year.

Is there no existing Crystal formula for the previous calendar year? How do people easily pull data for the previous calendar year?

Thanks!
 
I see 2 ways of doing this, but without crystal in front of me can't check them.

Way #1:
//{@LastFullYearStart}
Date(year(currentdate)-1,1,1)

//{@LastFullYearEnd}
Date(year(currentdate),1,1)-1

//Use in Select Expert
{table.Yourdate} in [{@LastFullYearStart} to{@LastFullYearEnd}]


OR


Way #2
//Also used in Select Expert
year({table.Yourdate}) = year(currentdate)-1
 
fisheromacse,

Thanks very much! I will try them!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top