Date Comparison in Crystal Reports 9
I am trying to compare two dates in Crystal. I need to see how many days and hours it took to complete a work order. I have a start date and will not always have an end date depending on whether or not the work order was completed.
The date format is currently 1/15/08 10:34 AM.
Any suggestions please?
Re: Date Comparison in Crystal Reports 9
I haven't used it myself, but what about the DataDiff function?
Re: Date Comparison in Crystal Reports 9
Welcome to the forums. :wave:
See the Date/Time Forumlas in this link.
Re: Date Comparison in Crystal Reports 9
Thank you both for the advice. I tried using the formula that was provided in the Forumula Date/Time chapter before and for some reason it didn't work that day. I tried it again today and :eek: - it worked. :blush:
I used this formula format and just formated the dates to show decimal points to account for not only the days but also the time.
{Orders.ShipDate} - {Orders.OrderDate}
Thank you again.
Re: Date Comparison in Crystal Reports 9
Next Question- Do you know how I would account for hours and minutes? The formula if just under 1 day of completion gives a .89 figure. I need to account for it actually being almost 21 hours of completion. Do you know how I would manipulate this?
Thanks again.
Re: Date Comparison in Crystal Reports 9
Nevermind- I think I may have found how to in the chapter as well. I guess I should have read more. :bigyello:
Thanks again.
Re: Date Comparison in Crystal Reports 9
I am now getting a runtime error of Numeric Overflow. The formula that I used to figure out the mintues and seconds is
Time(0,0,0) + ({Orders.CREATION_DATETIME} - {Orders.CLEARED_DATETIME})
Any suggestions how to fix this?:sick:
Re: Date Comparison in Crystal Reports 9
How large are the numbers?
Re: Date Comparison in Crystal Reports 9
If what you mean is the format of the numbers- 1/15/08 10:34 AM
Example: Creation Date:1/15/08 10:34 AM
Cleared Date: 1/16/08 12:34 AM
There are a few cases where the cleared date is less than the creation date-- I have no idea why the data was entered like that.:confused: I almost that this was the problem because the result would be in a negative number. Now- I just don't know.
Thanks.