Link to home
Start Free TrialLog in
Avatar of Tina K
Tina KFlag for United States of America

asked on

Crystal Reports date formatted as string, how to group

Hi Experts -
I have a report showing open orders, both past due and future - the ship date (a formula named @due_date) being Group#1.  I needed order lines past due to to display 'Past Due', rather than the date, and the future shipments to show the ship date.   I accomplished this by converting all the dates to text, doing a comparison, and using the text where appropriate.  However, now I've lost the ability to group my dates by month - since they are not dates anymore.  Now I have a six page report with a group header for each ship date, instead of the desired summary showing all shipments by month.
Any ideas how to get the grouping back?  Or did I handle the group formula incorrectly?

Original formula, returns error of 'String Required..' at last line :
if {@Due Date} < currentdate() then
'Past Due '
{@Due Date}

So, I did this:
if totext({@Due Date}, "MM/dd/yyyy") < totext(currentdate(), "MM/dd/yyyy") then
'Past Due as of '
totext({@Due Date}, "MM/dd/yyyy")

Works, but as mentioned, I can't group text fields by month.

Avatar of Mike McCracken
Mike McCracken

You should be able to group by the date field and specify the period Month, Week, Day.

You can then use one of the formulas to display the Past Due or shipping date.

Avatar of James0628

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