sql - List of months between two dates, with years in oracle -


i'm storing months, years , hours in different columns, , want sum hours when have entered 2 dates.

if have entered 2 dates suppose 03/01/2013 , 03/31/2015 should sum of hours between 03-2013 03-2015, including months , years in between.

select trunc( mod( (date1-date2)*24, 24 ) )  "hr" yourtable 

check out this article asktom.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -