Determine Number of Days in a month

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

Guest

I need to calculate the average weight for each month. How do I determine
the number of days for each month?
 
Sharon

Are you saying "how many days in September"? (hmmm, "30 days has ..." <g>).

One approach might be to feed Access a month and have it calculate the
number of days in that month. You could do this using the DateSerial()
function, and the fact that you get "last day of month" if you feed
DateSerial() the 0th day of the next month and use the Day() function to
return a day number -- e.g. (untested aircode):

Day(DateSerial(yyyy,MonthNumber + 1, 0))

Or am I missing something?

Regards

Jeff Boyce
<Office/Access MVP>
 
To expand slightly on Jeff Boyce's reply

Day(DateSerial(Year([SomeDateField]),Month([SomeDateFjeld])+1,0))
 
Back
Top