DateOfWeek ( week ; yearOfWeek ; type )
Calculate the first date of a given week and year
Average rating: 4.0 (42 votes) Log in to vote
Reinder Wolting ABECON http://www.abecon.nl |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
When you only have the week number and a year and you need to know a date in that week, this function calculates the date of the first day of that week. It also takes in account the prefered starting day.
Comments
Mark Rubenste, Evanston, IL Dec 29, 2014 |
||
This CF worked for week 1 last year (2014), but is one week off this year (2015). I think the the last line of code should be this: xFirstYearDate + ( ( week - If ( xFirstWeekDay > 6 ; 0 ; 1 ) ) * 7 ) - xFirstWeekDay + 1 NOT this: xFirstYearDate + ( ( week - If ( xFirstWeekDay > 4 ; 0 ; 1 ) ) * 7 ) - xFirstWeekDay + 1 In other words, > 4 should be > 6. Am I correct? |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.