Home » SQL & PL/SQL » SQL & PL/SQL » aproximize date
aproximize date [message #816] Wed, 06 March 2002 01:28 Go to next message
Godo
Messages: 1
Registered: March 2002
Junior Member
How aproximize date to 5 min
Re: aproximize date [message #818 is a reply to message #816] Wed, 06 March 2002 02:05 Go to previous message
THA
Messages: 26
Registered: February 2002
Junior Member
Hello
It may be a little bit elaborate, but may serve your perpose. here approximate is done at bottom level using trunc. change according to your need.

SELECT SYSDATE,
TO_DATE(
TO_CHAR(SYSDATE,'dd/mm/rr hh24:mi:')||
TO_CHAR(
TRUNC(TO_NUMBER(TO_CHAR(SYSDATE,'ss'))/5)*5
)
,'dd/mm/rr hh24:mi:ss')
FROM dual;
Previous Topic: distinct
Next Topic: Invoking external application
Goto Forum:
  


Current Time: Thu Apr 25 13:53:41 CDT 2024