How to find days b/w two dates

In this forum you can share stuff related to Oracle 11g, 10g, 9i.
Post Reply
keerti_rose
Posts: 40
Joined: Sat Mar 01, 2008 3:39 pm
Location: India

How to find days b/w two dates

Post by keerti_rose »

Hi Friends..

Can any one guide me..How to find days b/w two dates...
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post by admin »

select * from my_table where my_date between start_date and end_date;
mirza_rehan
Posts: 132
Joined: Sun Apr 02, 2006 10:36 am
Location: Pakistan

Post by mirza_rehan »

SELECT date2 - date1 FROM dual;


FOR example

SELECT TO_DATE('15-JAN-2008') - To_DATE('01-JAN-2008') diff_bet_date
FROM dual;


hope it will help you

regard
Rehan Mirza
admin
Posts: 2063
Joined: Fri Mar 31, 2006 12:59 am
Location: Pakistan
Contact:

Post by admin »

Thanks Rehan for giving more close answer so let see will it work for keerti_rose or he/she will again as only working days like excluding sundays. thanks
keerti_rose
Posts: 40
Joined: Sat Mar 01, 2008 3:39 pm
Location: India

Post by keerti_rose »

Hi Mate Thanks a lot
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests