March 30, 201510 yr 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.
March 30, 201510 yr 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.
April 2, 201510 yr 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
April 2, 201510 yr use the above custom function as a base for a calc field Actually, it was the other way around.
Create an account or sign in to comment