Reputation: 5
I'm very new to Crystal Reports and I've one little problem. I'll be quick and on point.
The columns are as follow: 2016-01-05, 2016-01-06, 2016-01-07, 2016-01-08, 2016-01-09 (list goes on till end of year) These dates come from Database field called NextDueDate and it populates the report with all the dates.
My question, is it possible to combine these rows or group them by weeks or perhaps by month?
Result I'm looking for is: 2016-01 (All january days combined here) or something like maybe even just January etc.
NextDueDate field is type string by the way. Also, I'd like to do this without getting involved in the actual database itself due to specific reasons.
Upvotes: 0
Views: 121
Reputation: 1182
you can use this simple formula as
@year_month = left ({NextDueDate},7);
create formula as year_month
and put left ({NextDueDate},7);
in formula editor click on save.
now you can see this formula under formula field in field explorer.
Drag this one to your detailed section.
You can group the result based on this formula.
OR
user these formula
@year_month = left ({NextDueDate},7);
@monthOnly = right( @year_month , 2);
@FullMonthName = if @monthOnly = '01' then 'January'
else if {@month} = '02' then 'February'
........................................
else 'December';
Upvotes: 1