Results 1 to 9 of 9

Thread: Date Comparison in Crystal Reports 9

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    7

    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?

  2. #2
    Hyperactive Member
    Join Date
    Jul 2007
    Posts
    479

    Re: Date Comparison in Crystal Reports 9

    I haven't used it myself, but what about the DataDiff function?

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Date Comparison in Crystal Reports 9

    Welcome to the forums.

    See the Date/Time Forumlas in this link.

  4. #4

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    7

    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 - it worked.

    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.

  5. #5

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    7

    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    7

    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.

    Thanks again.

  7. #7

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    7

    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?

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Date Comparison in Crystal Reports 9

    How large are the numbers?

  9. #9

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    7

    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. I almost that this was the problem because the result would be in a negative number. Now- I just don't know.

    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width