Re: How many months are in a range of dates?

From: Rick Rutt <rrutt_at_delphi.com>
Date: 1995/07/21
Message-ID: <5XJB4T0.rrutt_at_delphi.com>#1/1


Claudio Longo <Claudio_at_bnr.ca> writes:  

>Using a column (hire_date) and sysdate, how can I select the
>number of months a person has worked.
   

Use the MONTHS_BETWEEN(date1,date2) function, documented on page 2-57 of the PL/SQL manual (version 2.0). This returns a signed decimal number of months, and fractions of months between two dates. The last date in each month is treated special, so comparing to end-of-month dates always returns an even number of months (with no fractional part).  

  • Rick --

(Rick Rutt is a system architect living and working in Midland, Michigan.) Received on Fri Jul 21 1995 - 00:00:00 CEST

Original text of this message