HOME > A > Access Datedif Function: The Days Between Two Dates

Access datedif function: the days between two dates

With Microsoft Access you can operate the database system from Microsoft. Access gives this a graphical user interface, which increases usability and gives developers easier access. Access also provides functions to evaluate certain data, such as the datedif function, which calculates the distance between two dates.

What exactly does the datedif function do?

With Access or also Excel you can use the datedif function. This calculates for you the exact interval in days between two date values.
  1. The datedif command is structured as follows: DateDif(interval, date1, date2[, FirstDayOfWeek][,FirstWeekOfYear])
  2. The interval is the string expression that describes at what time interval the difference between date1 and date2 should be calculated.
  3. Date1 and date2 are the two dates between which the value is determined.
  4. The FirstDayOfWeek is an optional specification and describes the first day of the week, if this should be other than Sunday.
  5. The FirstWeekOfYear is also an optional specification, which specifies which week is the first week of the year. If nothing is specified here, the week containing the first of January is automatically taken.
  6. The difference can be output in different units. It depends entirely on what you pass as the interval. There are years (yyyy), quarters (q), months (m), days of the year (y), days (d), weekdays (w), weeks (ww), hours (h), minutes (n) and seconds (s).

By Cooke

Excel: Insert heading - how to name your table :: Sony Alpha 6000 night shots - how it works
USEFUL LINKS