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

Thread: rounding date

  1. #1
    Join Date
    Feb 2001
    Location
    Master Control
    Posts
    86
    would anybody know of an easy way to round the time in a date to the nearest quarter hour? i.e. 1:14 would be 1:15

    thanks,
    tron

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    I don't think it is possible without playing with a couple of various functions. One of the possible sollutions would be:

    SELECT TRUNC(sysdate,'HH24') + (ROUND(TO_NUMBER(TO_CHAR(sysdate, 'MI'))/15)*15)/(24*60)
    FROM dual;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  3. #3
    Join Date
    Feb 2001
    Location
    Master Control
    Posts
    86

    thanks!

    thanks for the reply...that works great!

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