We help IT Professionals succeed at work.
Get Started

Crystal Reports date formatted as string, how to group

Tina K
Tina K asked
on
487 Views
Last Modified: 2017-05-16
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 '
else
{@Due Date}

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

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

Thanks!
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE