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()

Calculate time intervals with DateAdd()

From the course: Access 2019: Queries

Start my 1-month free trial

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…

Contents