DaysAfter

Description

Gets the number of days one date occurs after another.

Syntax

DaysAfter ( date1, date2 )

Argument

Description

date1

A date value that is the start date of the interval being measured

date2

A date value that is the end date of the interval


Return value

Long. Returns a long containing the number of days date2 occurs after date1. If date2 occurs before date1, DaysAfter returns a negative number.

Examples

This expression returns 4:

DaysAfter(2005-12-20, 2005-12-24)

This expression returns -4:

DaysAfter(2005-12-24, 2005-12-20)

This expression returns 0:

DaysAfter(2005-12-24, 2005-12-24)

This expression returns 5:

DaysAfter(2004-12-29, 2005-01-03)

See also

Date

SecondsAfter