Jochen:

Actually, to be fair to Box, I used Excel to calculate the date. Just plug in the two dates with date format, then subtract them into a numeric cell, and you'll get the official "Microsoft supported" answer.

I was using this method to verify my code above, that how I know there's still a bug in there. It's weird, no matter how far back you go, it's still one or two days off ? You should use this to verify your script.

I think the leapyear function is cool ! Try running it with the following drivers:

code:

$year = 0
while $year < 2001
$leapyear_y = $year
gosub isleapyear
if $leapyear
?"$year is leapyear"
endif
$year = $year + 100
loop

or:

code:

$year = 1899
while $year < 2001
$leapyear_y = $year
gosub isleapyear
if $leapyear
?"$year is leapyear"
endif
$year = $year + 1
loop

Shawn.