From the course: Access 2019: Queries
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Calculate time intervals with DateAdd()
From the course: Access 2019: Queries
Calculate time intervals with DateAdd()
- [Instructor] The Date Add function will allow us to specify time frames, such as within the next 30 days or within the last year, and return records within that time frame. Let's see how it works by creating a new query in Design view. Then, we're going to pull out the Employees table, and from that, I'll add in the Employee ID and, finally, the hire date. Then, I'll come to column number three, and I'll right-click and go into the Expression builder. We can find the Date Add function by going to the Functions folder, clicking on Built-In Functions, then click on Date and Time functions, and, finally, we'll find Date Add here. The Date Add function will return a date to which a specified time interval has been added. The difference between Date Add and Date Diff, if you remember, is that Date Diff is returning an integer, whereas Date Add is returning an actual date. The Date Add function has three required parts. The interval is what we're adding, whether it's days, months, years…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Dates as serial numbers3m 58s
-
(Locked)
Select a range of dates or times3m
-
(Locked)
Date and time functions4m 56s
-
(Locked)
Format dates4m 38s
-
(Locked)
Sort dates chronologically5m 1s
-
(Locked)
Obtain today's date3m 22s
-
(Locked)
Calculate elapsed time with DateDiff()3m 47s
-
(Locked)
Calculate time intervals with DateAdd()4m 4s
-
(Locked)
Challenge: Expand order details34s
-
(Locked)
Solution: Expand order details5m 6s
-
(Locked)
-
-
-
-
-