Co'z you FLOORed the value and its 8.9 .. changed to 8. remove floor and use
31-MAY-2001 (last day of month) and you will get 9 .
Sandeep
-----Original Message-----
From: Johnson, Cameron [mailto:cameron.[Email Address Removed] Thursday, February 28, 2002 3:07 PM
To: LazyDBA.com Discussion
Subject: Function Months_Between
Does anyone know how the function months_between is calculated? We are
getting invalid results when we use 28_FEB as the end of month.
See example below:
1 select FLOOR(MONTHS_BETWEEN('31-JAN-2002', '30-may-2001')) MonthsA
2 ,FLOOR(MONTHS_BETWEEN('28-FEB-2002', '30-may-2001')) MonthsB
3 ,FLOOR(MONTHS_BETWEEN('31-MAR-2002', '30-may-2001')) MonthsC
4* from dual
SQL> /
MONTHSA MONTHSB MONTHSC
---------- ---------- ----------
8 8 10
MONTHSB should be 9.
Cameron Johnson
Information Technology Services
University Of Rochester
Rochester, New York 14620
585-273-2014
fax 585-273-1012
cell 585-451-2831
email: cameron.[Email Address Removed] to comment on our service?
http://www.uis.rochester.edu/syspub/doc/SurveyOnCall.htm Thanks.
--------
Oracle documentation is here:
http://tahiti.oracle.com/pls/tahiti/tahiti.homepage
To unsubscribe: send a blank email to oracledba-[Email Address Removed] subscribe: send a blank email to oracledba-[Email Address Removed] the list archive: http://www.LAZYDBA.com/odbareadmail.pl
Tell yer mates about http://www.farAwayJobs.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html
Oracle LazyDBA home page