Wednesday, August 13, 2008

How to find readable time difference bettween Oracle date types?

It is not crucial, but it is cool. This way you can find time date/time difference nicely. its very cool :-)

SELECT
lpad(EXTRACT(HOUR FROM(dend_date - dstart_date) DAY TO SECOND),2,’0′) ‘ hour ‘ lpad(EXTRACT(MINUTE FROM(dend_date - dstart_date) DAY TO SECOND),2,’0′) ‘ minute ‘ lpad(EXTRACT(SECOND FROM(dend_date - dstart_date) DAY TO SECOND),2,’0′) ‘ second ‘ “Interval”FROM process_logorder by dstart_date desc;

ref::Oracle® Database SQL Reference10g Release 2 (10.2)B14200-02

thanks to: http://inanme.wordpress.com/2007/01/29/how-to-find-readable-time-difference-bettween-oracle-date-types/

No comments:

Shared Cache - .Net Caching made easy

All information about Shared Cache is available here: http://www.sharedcache.com/. Its free and easy to use, we provide all sources at codeplex.

Facebook Badge