angellll is close...
The Year() needs a date... like Year(now)
To make it a function for any time...
Public Function LeapYear( D as Date ) as Boolean
if DatePart("d", DateSerial(Year(D), 3, 0)) = 29 then
LeapYear = True
else
LeapYear = False
end Function
Then call LeapYear(Now)
Main Topics
Browse All Topics





by: angelIIIPosted on 2009-10-26 at 14:32:18ID: 25667149
take this expression:
datepart("d", dateserial(year(), 3 , 0 ))
if that returns 29, it's a leap year