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.- The datedif command is structured as follows: DateDif(interval, date1, date2[, FirstDayOfWeek][,FirstWeekOfYear])
- The interval is the string expression that describes at what time interval the difference between date1 and date2 should be calculated.
- Date1 and date2 are the two dates between which the value is determined.
- The FirstDayOfWeek is an optional specification and describes the first day of the week, if this should be other than Sunday.
- 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.
- 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).