Results 1 to 3 of 3

Thread: DateDiff function???????

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    I have a temp table that gives me two time entries we'll say invoice_date1 and invoice_date2

    i need to extract the time difference between the two dates and if it is greater than an hour or 60 minutes i need to return it in a count statement.

    how would i do this?

    i did this and it is not working:
    SELECT COUNT (*)
    FROM #WorkingData
    WHERE ledger_id IS NULL
    AND ledger_id < 0
    AND DATEDIFF ( mi , invoice_date1, invoice_date2) > 60

    the only part that does not work in this is my date statment when i query before that statement I get correct results after that statement I do not.

  2. #2
    Junior Member
    Join Date
    Jun 2000
    Posts
    27
    Try to put the , mi in a string ,DATEDIFF ( "mi" , invoice_date1, invoice_date2) > 60



  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    Yes, that works great for a static date!!!

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