Glossary > Access
Returns the number of intervals between two dates. This can be days, months, years, etc.
- DateDiff(Interval, Date1, Date2, [FirstDayOfWeek], [FirstWeekOfYear])
Interval can be:
- yyyy - Year
- q - Quarter
- m - Month
- y - Day of Year
- d - Day
- w - Weekday
- ww - Week of Year
- h - Hour
- n - Minute
- s - Second
Date1 and Date2 are valid DateTime fields
FirstDayOfWeek is optional and can be:
- 0 - vbUseSystemDayOfWeek - Use the NLS API setting.
- 1 - vbSunday - Sunday [default]
- 2 - vbMonday - Monday
- 3 - vbTuesday - Tuesday
- 4 - vbWednesday - Wednesday
- 5 - vbThursday - Thursday
- 6 - vbFriday - Friday
- 7 - vbSaturday - Saturday
FirstWeekOfYear is optional and can be:
- 0 - vbUseSystem - Use the NLS API setting.
- 1 - vbFirstJan1 - Start with week in which January 1 occurs (default).
- 2 - vbFirstFourDays - Start with the first week that has at least four days in the new year.
- 3 - vbFirstFullWeek - Start with first full week of the year.
RESOURCES: