Tattwam Posted March 30, 2015 Posted March 30, 2015 Hello all. I want a script or custom function to calculate: whether a specific day is xth day of month? For e.g. If date field is 2nd (xth) Monday (any day) of month - Result should be true otherwise it should result into false. If there would be any custom function, it will be great!! Thanks.
comment Posted March 30, 2015 Posted March 30, 2015 If date field is 2nd (xth) Monday (any day) of month - Result should be true otherwise it should result into false. The temptation here is to start by calculating the actual date that is the x-th weekday of the given month. That is certainly possible, but not as easy as the alternative - considering you only want a true-or-false result. So we only need to test for: is the given date the requested day-of-week? is the given date in the requested week of the month? DayofWeek ( Datefield ) = weekday and Ceiling ( Day ( Datefield ) / 7 ) = x where weekday is a number between 1 (Sunday) and 7 (Saturday) and x is the number of the occurrence you are looking for.
Markpelleymounter Posted April 2, 2015 Posted April 2, 2015 One posted to Brian Dunning's excellent repository of custom functions today: http://www.briandunning.com/cf/1757. You can then use the above custom function as a base for a calc field
comment Posted April 2, 2015 Posted April 2, 2015 use the above custom function as a base for a calc field Actually, it was the other way around. 1
Recommended Posts
This topic is 3790 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