bb84604 Posted March 28, 2005 Posted March 28, 2005 I'm trying to figure out how to calculate a date from a week #. I have a simple calendar that I can switch from one week to the next. So if I am on week 14 I want it to calculate the date of Monday on that week (3/28/2005). Thanks,
comment Posted March 28, 2005 Posted March 28, 2005 Assuming your week# is the same as Filemaker's WeekOfYear, and that it refers to the current year, the date of Monday is: Date ( 1 , 1 , Year ( Status (CurrentDate) ) ) - DayOfWeek ( Date ( 1 , 1 , Year ( Status (CurrentDate) ) ) ) + 7 * ( week - 1 ) + 2
bb84604 Posted March 28, 2005 Author Posted March 28, 2005 Thanks, that worked. Only problem is I don't understand exactly how it worked. Is there any chance you could just line item what it is doing in lay terms? Thanks so much.
comment Posted March 28, 2005 Posted March 28, 2005 // THE DATE OF NEW YEAR Date ( 1 , 1 , Year ( Status (CurrentDate) ) // MINUS THE DAY OF WEEK OF NEW YEAR - DayOfWeek ( Date ( 1 , 1 , Year ( Status (CurrentDate) ) ) ) // IS THE SATURDAY BEFORE NEW YEAR + 7 * ( week - 1 ) // IS THE SATURDAY BEFORE THIS WEEK + 2 // IS THE MONDAY THIS WEEK
bb84604 Posted March 28, 2005 Author Posted March 28, 2005 Awesome. Thank you. Sorry I'm so thick today, I should have known that.
Recommended Posts
This topic is 7248 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