Google Answers Logo
View Question
 
Q: Counting Weekdays ( No Answer,   0 Comments )
Question  
Subject: Counting Weekdays
Category: Computers > Algorithms
Asked by: codemasterjs-ga
List Price: $5.00
Posted: 20 Apr 2004 07:08 PDT
Expires: 21 Apr 2004 11:44 PDT
Question ID: 333032
Does anyone have an efficient, simple algorithm for calculating the
number of occurrences of a weekday between 2 dates? I don't want to
step through each day and use a weekday function to check the day of
week and increment a counter. I'm using VBA so I have all the built in
VBA date/time functions.

Request for Question Clarification by mathtalk-ga on 20 Apr 2004 08:38 PDT
So, for example, given date "Apr 2, 1979" and "Dec 14, 2003", you'd
like to know how many Wednesdays occur in between?

Do you include the endpoints in your count (it doesn't make the task
harder one way or the other, but it requires a specification)?

Depending on how you count the endpoints, it suffices to know the date
of the week for the first date and the number of days between the two
dates.

regards, mathtalk-ga

Clarification of Question by codemasterjs-ga on 21 Apr 2004 06:30 PDT
yes that's exactly it, and I would like it to include endpoints
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy