Domino Code Fragment

Code Name*
What's the date of the Last Thursday in November?
Date*
04/28/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.18.217.158.184
Description*
Returns the last Thursday of Nov.
Type*
Formula
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:

You can do this if you have these field values:

Month = the month (a number)
Year = the year (a number)
Weekday = the weekday you are trying to find (a number)


Here's the formula:

twenty8 :=@Date(Year;Month;28);
wkdate := @Weekday(twenty8);
forwardDate := @If(Weekday >=wkdate;
@Adjust( twenty8; 0; 0; Weekday-wkdate; 0; 0; 0 );
@Adjust( twenty8; 0; 0; 7-(wkdate - Weekday);0;0;0));
@If(@Month(forwardDate) > Month;
@Adjust(forwardDate; 0; 0; -7; 0; 0; 0 );
forwardDate)