Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL: Getting the difference of two date fields in seconds.

Re: SQL: Getting the difference of two date fields in seconds.

From: Daniel Ebright <debright_at_mortgageflex.com>
Date: Fri, 16 Jul 1999 14:51:08 -0400
Message-ID: <378F7F1C.72BF8BCA@mortgageflex.com>



I am new to news groups and I hope I did this correctly...

I am not sure if you are looking for the difference of the 2 date fields or the months/days between.
This will give you the difference in days.
Variations on a theme...remove the *31 multiplier to give you the figure in months.
Hope it helps...

SELECT ROUND(MONTHS_BETWEEN(datefield1,datefield2) * 31) FROM table1

Jerel Thompson wrote:

Hi,

    I have two date fields.  A start date and an end date.  How do I find
the difference of the two dates in seconds in SQL?  I am using Oracle 8.0
for linux.

Received on Fri Jul 16 1999 - 13:51:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US