finding the number of day by give the month and year

finding the number of day by give the month and year

Post by *egu » Wed, 23 Feb 2005 18:13:03


Hi all,

How can I find the number of days in the month and year given?

eg. Feb 2005 has 28 days.

Thanks,
Eguy
 
 
 

finding the number of day by give the month and year

Post by Harold Dru » Wed, 23 Feb 2005 19:29:00

Hi eguy

**********************************************************
Private Function NumberOfDays(lYear As Long, lMonth As Long) As Long

NumberOfDays = Day(DateSerial(lYear, lMonth + 1, 0))

End Function
***********************************************************

Good luck
Harold