Description: Returns the number of
intervals between two dates/times.
Interval :
yyyy
year
q
quarter
m
month
d
day
ww
week
w
weekday
y
day of year
h
hour
n
minute
s
second
Date1 :
First date and time to consider
Date2 :
Second date and time to compare with.
FirstDayofWeek :
Optional. This constant specifies which day is
considered to be the start of the week. 0 is the system
default, 1 is Sunday, 2 is Monday, 3 is Tuesday, and so
on.
FirstWeekOfYear :
Optional. This constant specifies the first week
of the year. If not specified the first week of the year is
considered the week of January the 1st. 0 is the system
default, 1 is week of January the 1st, 2 starts with the week
that has at least 4 days, 3 starts the year with the first
full week.
Example:
Compute the number of
years between the two dates
given. =DateDiff("yyyy","01/01/2000","01/01/2003")
Compute the number of quarters
between the two dates
given. =DateDiff("q","01/01/2000","01/07/2000")
Compute the number of months
between the two dates
given. =DateDiff("m","01/01/2000","01/07/2000")
Compute the number of days between the
two dates
given. =DateDiff("d","01/01/2000","10/01/2000")
Compute the number of weeks between the two dates
given. =DateDiff("ww","01/01/2000","01/02/2000")
Compute the number of hours
between the two times
given. =DateDiff("h","12:05:30","15:30:10")
Compute the number of minutes
between the two times
given. =DateDiff("n","12:05:30","12:09:35")
Compute the number of seconds
between the two times
given. =DateDiff("s","12:05:30","12:05:35")