DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Date Math

  1. #1
    Join Date
    Dec 2007
    Posts
    6

    Date Math

    Is there an easy way to perform date math in PLSQL? I see ADD_MONTHS in the documentation, but what I'm looking for is something similar to the SQL Server 2000 datediff function. For example, I'm looking for a way to calculate the difference between the following two date/times in Oracle 10g:

    Start: 06/13/2008 21:40:22
    Finish: 06/14/2008 03:21:41

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    No. Some coding is needed.

    John K. Hinsdale posted a function called time_diff, you can find it at http://www.psoug.org/reference/date_func.html ... it might help you.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

  3. #3
    Join Date
    Dec 2007
    Posts
    6
    Okay. Thanks! This looks like a good start for what I need to do.

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