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))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top