Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 1 of 1 total
Thread LIB - func - IsLeapYear.sql
Mon, Feb 6 2012 12:26 PMPermanent Link

Lucian

CREATE FUNCTION "IsLeapYear" (
IN "AYear" INTEGER)
RETURNS BOOLEAN
BEGIN
 DECLARE Result BOOLEAN DEFAULT False;

 IF AYear MOD 4 = 0 THEN
   IF (AYear MOD 100 > 0) OR (AYear MOD 400 = 0) THEN
     SET Result = True;
   END IF;
 END IF;

 RETURN Result;
END

DESCRIPTION 'Boolean function to return TRUE if the given year is a leap year.'
Image