Re: Last day of month..
Posted in 1998
Louis DeLongchamp — — source: Informix-list mailing list archive (1991-1998)
>SUNIL S. SINGH wrote: > >Hi All !! > >Is there any function or technique to find last day of month >ie 29 or 28 or 30 or 31 for a particular date(dd/mm/yy) > Here is the function that will do it! The function takes your date and returns the last day ie. 28, 29, 30 or 31. function fn_leap(fndate) define fndate date, j, k smallint let j = month(fndate) if j = 4 or j = 6 or j = 9 or j = 11 then return 30 end if if j <> 2 then return 31 end if let k = year(fndate) if k mod 100 = 0 then if k mod 400 = 0 then return 29 else return 28 end if else if k mod 4 = 0 then return 29 end if end if return 28 end function loudelon...