User wants to compare data in a current period to data in the same period a year earlier. Current period is defined by begin and end parameters.
What's a good way to calculate the begin and end of the prior date range? I tried the following (for the begin date) but Crystal complains that "yyyy" is invalid giving no clue what's invalid about it.
date(datepart(yyyy, datetime({@CURRENTminDate}))-1,
datepart(m,datetime({@CURRENTminDate})),
datepart(d, datetime({@CURRENTminDate})))
What's a good way to calculate the begin and end of the prior date range? I tried the following (for the begin date) but Crystal complains that "yyyy" is invalid giving no clue what's invalid about it.
date(datepart(yyyy, datetime({@CURRENTminDate}))-1,
datepart(m,datetime({@CURRENTminDate})),
datepart(d, datetime({@CURRENTminDate})))