well, for a start, here is the definition (with thanks to google): In the Gregorian calendar, which is the calendar used by most modern countries, the following rules decides which years are leap years: 1. Every year divisible by 4 is a leap year. 2. But every year divisible by 100 is NOT a leap year 3. Unless the year is also divisible by 400, then it is still a leap year. so in the first step, I would round the lower bound YYYY value up to the next multitude of 4, round the upper bound YYYY value down to the previous multitude of 4 -- this gives you a starting value. then, in a similar way, subtract the multitudes of 100; and finally, add a correction for the multitudes of 400. kind regards, Lex. ------------------------------------------------------------------ Steve Adams Seminar http://www.naturaljoin.nl/events/seminars.html ------------------------------------------------------------------ -----Original Message----- From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Inessa Weiner Sent: Tuesday, May 24, 2005 16:01 To: oracle-l@xxxxxxxxxxxxx Subject: leap year Hi, I need to write a PL/SQL function to show how many times the leap year occurred between two dates. The maximum range between dates is 10 years. Please help. Thanks, Inessa. -- //www.freelists.org/webpage/oracle-l -- //www.freelists.org/webpage/oracle-l