【NthDayofMonth】
[code]Inputs: StrtDate(Numeric), Nth(Numeric), TargtDay(Numeric);condition1 = DayOfWeek(JulianToDate(StrtDate)) <= TargtDay ;
If condition1 Then Begin
NthDayofMonth = StrtDate + ((Nth - 1) * 7) + (TargtDay - DayOfWeek(JulianToDate(StrtDate)));
End
Else Begin
NthDayofMonth = StrtDate + ((Nth) * 7) - (DayOfWeek(JulianToDate(StrtDate)) - TargtDay );
End;
[/code]
页:
[1]