Link to home
Start Free TrialLog in
Avatar of Taras
TarasFlag for Canada

asked on

Crystal Report Last Year YTD full month

In creating YTD Last Year full month formula.
Formula1:
If ({table1.Start_Date} in Date (Year(CurrentDate) -1, 01, 01) to DATEADD(year(CurrentDate), -1, CurrentDate - Day(CurrentDate))) then
{Table1.Amount}
Else
0;

I am getting error in part:  DATEADD(year(CurrentDate),  highlight is on Year(CurrentDate) and error is String is required here
Any Idea?
Avatar of Taras
Taras
Flag of Canada image

ASKER

I found this one work for me:
date field in dateserial(year(currentdate),month(currentdate)-13,1) to dateserial(year(currentdate),month(currentdate)-12,1-1)

But I was wondering what is wrong with my formula.?
SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Taras

ASKER

Thanks a lot