Home » SQL & PL/SQL » SQL & PL/SQL » Date difference in days (Oracle10g)
Date difference in days [message #390816] Mon, 09 March 2009 22:53 Go to next message
sr_orcl
Messages: 82
Registered: January 2009
Location: mumbai
Member

Hi,
I have to calculate the date difference betwen two date .It should returns me days only.

I used this query but it returns me months and years seprately i want t should retuns only days


select get_date(5000),rd.allocdate,
trunc(round(months_between( get_date(5000), rd.allocdate) ) /12 ) Years,
mod( trunc(months_between(get_date(5000), rd.allocdate) ), 12 ) months
from rcptbook_dtl rd

Please need some suggestions
Re: Date difference in days [message #390819 is a reply to message #390816] Mon, 09 March 2009 23:18 Go to previous messageGo to next message
ashoka_bl
Messages: 398
Registered: November 2006
Location: Bangalore
Senior Member

May be this would help you,
SELECT sysdate,sysdate-1,TRUNC (SYSDATE - (SYSDATE - 1)) Date_Diff_In_days
FROM DUAL


Regards,
Ashoka BL
Bengaluru
Re: Date difference in days [message #390820 is a reply to message #390816] Mon, 09 March 2009 23:23 Go to previous message
sr_orcl
Messages: 82
Registered: January 2009
Location: mumbai
Member

Thanks For your suggestion
Previous Topic: UNION ALL with ORDER BY
Next Topic: Dbms_lob help
Goto Forum:
  


Current Time: Thu Dec 08 08:17:35 CST 2016

Total time taken to generate the page: 0.07828 seconds