Date info

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello there. My issue is simple:

Is it possible to count the number of days in a month? I have a form for
filling with certain information, and for that I must have in the form, as
much fields as days in a specific month, that is why I need to know the
amount of days previously, of course also considering the year, you know due
to the feb 29 each 4 years. Thanks
 
Is it possible to count the number of days in a month? I have a form for
filling with certain information, and for that I must have in the form, as
much fields as days in a specific month, that is why I need to know the
amount of days previously, of course also considering the year, you know due
to the feb 29 each 4 years. Thanks

Type the following into the immediate window for an example of how to obtain the
number of days in this month:

? Format(DateSerial(Year(Date()),Month(Date())+1,0),"d")

To get the number of days in last month, leave out the "+1" in the month
argument of the DateSerial() function. Leap years are already accounted for in
Access (VBA) date functions.
 
Back
Top