Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Number of Mondays in a month
Message
From
20/10/2016 01:21:46
 
 
To
19/10/2016 20:31:42
Bill Fitzgerald (Online)
Woodbury Systems Group
Hamilton, New Jersey, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01642129
Message ID:
01642131
Views:
79
>The application has to determine how many occurrences of a given day of the week occurred in a given calendar month.
>
>For example- How many Mondays (or any other specified day of the week) were there in February, 2016?
>I can see how to get the answer by looping through all the days in the month in question, but is there a slicker way?

Shouldn't be that hard, Bill

- Take the first day of the month
- Determine what day of the week it is, if not a Monday, advance n days until the first Monday of the month ( do not use a loop)
- Then see how many more days there are in that month
- integer division by 7
Gregory
Previous
Reply
Map
View

Click here to load this message in the networking platform