Topic: SQL*Plus and PL/SQL >> Sql query
|
Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property.
You may review the entire Oracle Certification Program Candidate Agreement online Here.
|
|
|
|
| Rajesh |
Posted: Oct 27, 2006 03:15:03 AM |
Total Post: 1
Joined: Oct, 2006
|
How to find the number of days ,number of months , number of years
between two dates. |
|
|
nirav |
| Posted: Oct 29, 2006 03:48:19 AM | |
|
Total Post: 20
Joined: Jun, 2005
|
try something like : select date1 - date2 from dual;
where date1 =to_date('01/19/2001','mm/dd/yyyy')= for example..
now when you want months, try to truncate them to months and same for years
|
|
|
|
|
Prakash |
| Posted: Nov 04, 2006 01:55:14 AM | |
|
Total Post: 112
Joined: Aug, 2006
|
Try using months_between function.
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |
|
|
|
|
Forum Rules & Description
Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user
|
| |
Get FREE Magazines
|
Top 10 Forum User
|
| Murtuja Khokhar | 857 |
| Mohammed Taj | 746 |
| positive fanatic | 483 |
| Jayanta Sur | 479 |
| Vigyan Kaushik | 386 |
| Gopu Gopi | 334 |
| Gitesh Trivedi | 322 |
| Vinoth Kumar | 264 |
| neeraj sharma | 258 |
| Ramesh Jois | 246 |
|
|