Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

number of days between two dates 2

Status
Not open for further replies.

latha9

Programmer
Dec 20, 2005
12
US
Hi,

I need to find the number of days between sysdate and database column (this is varchar2 datatype).Can any one help me how to do it.

Thanks,
Latha
 
Convert your varchar2 to a date, then subtract the greater date from the earlier one.
 
Code:
trunc(sysdate) - to_char(your_date,'MM/DD/YYYY')
In the mask, use whatever format your date needs.

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
I think BJCooper deserves more credit than I. Share my star!
 
Very kind of you lewisp. [hourglass]

[sup]Beware of false knowledge; it is more dangerous than ignorance.[/sup][sup] ~George Bernard Shaw[/sup]
Consultant Developer/Analyst Oracle, Forms, Reports & PL/SQL (Windows)
My website: Emu Products Plus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top