1
votes

Relatively new to Crystal Reports. I'm trying to get a date to populate normally if it is after today's date, but with a leading and following asterisk if it's prior to today's date.
What I tried:

if {V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE}>CurrentDate then {V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE}
else "* " &({V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE}) & " *"

When I check the formula I receive "A date-time is required here" error relating to:

"* " &({V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE}) & " *"

Little help for a newbie? (Also, yes, I realize "availability" is spelled incorrectly.)

1

1 Answers

0
votes

I was missing was the date formatting for the else statement:

if {V_ORD_AVALIABILITY.MUST_SHIP_DATE} = DATE(0000,00,00)
then " "
else (if {V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE} <= CurrentDate
then totext({V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE}, "* M/d/yy *")
else totext({V_ORD_DTL_AVALIABILITY.MUST_SHIP_DATE}, "M/dd/yy")}