DATETONR(D the_date)
N numeric_representation
DATETONR converts a date to the number of days since 1st March 1980To work out the day of the week, use MOD 7. The date 1st March 1980 is a Saturday, and so the modulus will range from 0 for Saturday through to 6 for Friday
DATETONR(02.03.81) = 366DATETONR(08.03.80) MOD 7 = 0 {Saturday gives 0}