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!

One Year Ago formula 1

Status
Not open for further replies.

blueboyz

Technical User
Sep 13, 2005
210
US
I'm using Crystal v9, pervasive sql.

I'm trying to get a formula to extract the transaction amounts that are in the same period as the start and end dates, but for the last year.

I set up two parameters:
{StartDate}
{EndDate}

I need the formula to figure what the date was last year of the {StartDate} and the date for last year of the {EndDate}.

My report shows the transactions amounts for the Current Period which is equal to transaction dates between and including the {StartDate} and {EndDate}.

It also needs to show the transaction amounts for the same period last year. This is where I'm lost.

I've tried: DateDiff({?Start Date}"mm"-12, "yyyy"-1)
But this returns an error "the ) is missing on the "mm" of the formula.

 
Try DateAdd ("yyyy",-1,{StartDate}) and DateAdd ("yyyy",-1,{EndDate})
 
Thanks so much. Those formulas worked perfectly!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top