Todd Dignan Posted February 13, 2004 Posted February 13, 2004 Is there a way to calc how many days are there in the last week of month by using a date field? i.e. 3/29/2004 is the forth week of the month but how many days are in that week for that month? Answer is 3.
Vaughan Posted February 13, 2004 Posted February 13, 2004 I'm assuming that the week starts on Sunday, not Monday. Learn about the DayOfWeek function. It'll probably give you the answer. To find the last day of any month, calculate the first day of the next month and subtract one day. Errr, by my calculations there are 5 weeks in February 2004, and there is 1 day in the last week. Unless I've got it wrong...
Todd Dignan Posted February 13, 2004 Author Posted February 13, 2004 Thank you. I meant march, I changed by post.
Lee Smith Posted February 13, 2004 Posted February 13, 2004 Hi tdignan, (WeekofYear(YourDate)-WeekofYear(Date(Month(YourDate), 1,Year(YourDate)))) + 1 Lee
rdhaden Posted February 13, 2004 Posted February 13, 2004 Here's my calc, assuming Sunday start of week. Day of Week returns a number, 1 being Sunday, 7 being Saturday, so determine day of week of last day of month (first day of next month - 1). This number would coincidentally also be how many days in the week. DayofWeek(Date(Month(OurDate) + 1, 1, Year(OurDate)) - 1)
bruceR Posted February 15, 2004 Posted February 15, 2004 Or: DayofWeek( Date(Month(OurDate) + 1, 0, Year(OurDate)) ) Day zero of any month is the last day of the prior month.
Recommended Posts
This topic is 7924 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now