A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Determine Number of Days in a month



 
 
Thread Tools Display Modes
  #1  
Old November 16th, 2005, 07:58 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Determine Number of Days in a month

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


  #2  
Old November 16th, 2005, 08:42 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Determine Number of Days in a 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

"SharonInGa" wrote in message
...
I need to calculate the average weight for each month. How do I determine
the number of days for each month?




  #3  
Old November 16th, 2005, 09:18 PM posted to microsoft.public.access.reports
external usenet poster
 
Posts: n/a
Default Determine Number of Days in a month

To expand slightly on Jeff Boyce's reply

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


"Jeff Boyce" wrote in message
...
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

"SharonInGa" wrote in message
...
I need to calculate the average weight for each month. How do I determine
the number of days for each month?






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Access Limits (file size, table records, users) Mike General Discussion 4 November 4th, 2005 03:01 AM
Combo Box & Text Box AccessRookie Using Forms 3 April 6th, 2005 11:33 PM
want other value in query and report GI Smith New Users 10 January 5th, 2005 02:03 AM
counting days vers 2 brad Worksheet Functions 3 April 20th, 2004 06:24 PM
date conversion web_time Worksheet Functions 10 December 25th, 2003 06:51 PM


All times are GMT +1. The time now is 04:34 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.