Page 1 of 1

How to find days between two dates

Posted: Mon Mar 02, 2009 5:37 am
by musman
i want to find days between two dates

example

p_from_date = '2009/01/01 HH24:MI:SS'

p_to_date = '2009/12/09 HH24:MI:SS'

How i find exact days between these two dates.

Posted: Fri Mar 06, 2009 9:06 am
by Kashif

Code: Select all

Select to_date('2009/12/09','YYYY/MM/DD') - to_date('2009/01/01','YYYY/MM/DD')
from dual
if there is time involved, then use the TRUNC function to get the exact number of days between 2 dates.