DateDiff Function |
DateDiff(interval, dateexpr1, dateexpr2)
Returns the number of intervals between two dates.
|
Parameter |
Description |
|
This string value indicates which kind of interval to add. |
|
|
Add this many intervals. Use a negative value to get an earlier date. |
|
|
Calculate the new date relative to this date value. If this value is Null then Null is returned. |
|
Interval |
Description |
|
yyyy |
Year |
|
q |
Quarter |
|
m |
Month |
|
y |
Day of year |
|
d |
Day |
|
w |
Weekday |
|
ww |
Week |
|
h |
Hour |
|
n |
Minute |
|
s |
Second |
Sub Main
Debug.Print DateDiff("yyyy",#1/1/1990#,#1/1/2000#) ' 10
End Sub