Link to home
Start Free TrialLog in
Avatar of Maliki Hassani
Maliki HassaniFlag for United States of America

asked on

Crystal Reports: determine date range in various weeks

Hello Experts,

I have a chart that list data points for each week.  The table that I am using only has a field called "reporting_year_week", which displays weeks like "2014-W27".  I need help writing a formula that will evaluate the "2014-W27" and provide the following dates range.  Here are examples:
06/09-06/15
06/16-06/22
06/23-06/29
06/30-07/06

Unfortunately, if I had a single date in the table then I would be able to use a formula like this, but I don't so I have to evaluate the "2014-W27".

local datetimevar start;
local datetimevar end;
start:= CurrentDate-weekday(CurrentDate,2)+1;
End:=start+6;
{@reporting_year_week} & chr(10)&
totext(start,"MM/dd") & "-" &  totext(end, "MM/dd")
ASKER CERTIFIED 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
Avatar of Maliki Hassani

ASKER

That works!  Thanks mlmcc!