* if not yet received If EMPTY(Received) * work out the number of working days (Monday to Friday, not holidays) since forwarded LapsedDays = WorkingDays(Forwarded, Current Date) - Holidays(Forwarded, Current Date) if LapsedDays > Limit Status = "OverDue" else Status = "Pending" endif else Status = "Settled" endifThe working days function I got from fox.wikis.com:
Lparameters date1, date2, include_date1 Local jn1, jn2 jn1 = Val(Sys(11, m.date1)) && ALTERNATIVE: jn1=Val(Sys(11, Min(m.date1, m.date2)) - iif(include_date1, 1, 0) jn2 = Val(Sys(11, m.date2)) && ALTERNATIVE: jn2=Val(Sys(11, Max(m.date1, m.date2)) jn1 = iif(include_date1 AND m.jn1<=m.jn2, m.jn1 - 1, m.jn1) && ALTERNATIVE: remove this line jn2 = iif(include_date1 AND m.jn1>m.jn2, m.jn2 - 1, m.jn2) && ALTERNATIVE: remove this line Return (int(m.jn2 / 7) - int(m.jn1 / 7)) * 5 - Min(m.jn1 % 7 + 1, 5) + Min(m.jn2 % 7 + 1, 5)The Holidays is just a matter of pulling out a count of all holidays between the two specified dates from a holidays table.