Crystal v9
DB2
I'm trying to conditionally display a text string based upon the date an order was discontinued. The report can span multiple days and each 'day' is considered to be any period of time spanning 24 hr. So a day could start at 6/2/05 1:30:00 and end on 6/5/05 1:29:59. Here is my formula but it's not working correctly and I'm not sure how to fix it:
if (date({Table.DATETIME}) = Date({Table.BEGINDATETIME}))
then "Discontinued " + totext({Table.DATETIME},"MM/dd/yy hh:mm")
else
if (date({Table.DATETIME}) > Date({Table.BEGINDATETIME})
and
DateDiff ("s",{Table.DATETIME},{Table.BEGINDATETIME}) < 86400)
then "Discontinued " + totext({Table.DATETIME},"MM/dd/yy hh:mm")
else ""
My date range could be for a 3 day report:
Start Date 6/2/05 01:30:00 End Date 6/5/05 01:29:59
I discontinued an order on 6/3/05 at 08:28:00
My display should look like this:
6/2/05 6/3/05 6/5/05
Discontinued
6/3/05 08:28
but I'm getting this instead:
6/2/05 6/3/05 6/5/05
Discontinued Discontinued
6/3/05 08:28 6/3/05 08:28
Any help would be appreciated, thanks!
Jacque
DB2
I'm trying to conditionally display a text string based upon the date an order was discontinued. The report can span multiple days and each 'day' is considered to be any period of time spanning 24 hr. So a day could start at 6/2/05 1:30:00 and end on 6/5/05 1:29:59. Here is my formula but it's not working correctly and I'm not sure how to fix it:
if (date({Table.DATETIME}) = Date({Table.BEGINDATETIME}))
then "Discontinued " + totext({Table.DATETIME},"MM/dd/yy hh:mm")
else
if (date({Table.DATETIME}) > Date({Table.BEGINDATETIME})
and
DateDiff ("s",{Table.DATETIME},{Table.BEGINDATETIME}) < 86400)
then "Discontinued " + totext({Table.DATETIME},"MM/dd/yy hh:mm")
else ""
My date range could be for a 3 day report:
Start Date 6/2/05 01:30:00 End Date 6/5/05 01:29:59
I discontinued an order on 6/3/05 at 08:28:00
My display should look like this:
6/2/05 6/3/05 6/5/05
Discontinued
6/3/05 08:28
but I'm getting this instead:
6/2/05 6/3/05 6/5/05
Discontinued Discontinued
6/3/05 08:28 6/3/05 08:28
Any help would be appreciated, thanks!
Jacque