Domino Code Fragment

Code Name*
Next Payday
Date*
03/09/2004
Source (or email address if you prefer)*
patcote1@airmail.net
IP address:.66.236.144.50
Description*
Calculates the next payday based on bi weekly pay on Thursdays
Type*
Formula
Categories*
Date/Time Handling
Implementation:
None (plug and play)
Required Client:
(none)
Server:
(none)
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
REM {compute the next biweekly pay date - on Thursdays every two weeks beginning Jan 8, 2004};
rem "get the number of weeks from first pay day to today (NumWeeks)";
rem "then get the integer value of that number (intNumWks)";
rem "check if it's an even number (compare divide by zero and divide by zero with int) (checkEven)";
rem "if it's an even number, add two, if odd, add one (H)";
rem "take that number, mult by 7, and add to first pay day for next pay day (I)";

EndDate := @Date(@Today);
StartDate := @Date(2004; 1; 8);
NumWeeks := (EndDate - StartDate)/60/60/24/7;
intNumWks := @Integer(NumWeeks);
checkEven := @If(intNumWks/2=@Integer(intNumWks/2);"y";"n");
AdjPeriods := @If(checkEven="y";intNumWks+2; intNumWks+1);
AdjDays := AdjPeriods*7;
NextPay := @Adjust(StartDate;0;0;AdjDays;0;0;0);
NextPay