From the course: Access 2016: Advanced Tips and Tricks

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use custom functions in queries

Use custom functions in queries

From the course: Access 2016: Advanced Tips and Tricks

Start my 1-month free trial

Use custom functions in queries

- [Voiceover] Once your custom public functions have been defined in the visual basic module, such as the My Functions module that we created in the last movie, you can make use of them throughout your database. Let's go ahead and take a look at a couple of examples, and I'm gonna start by going up here to the Create tab and opening up a new query in design view. Now I want to make a query that examines some of my employees' information, so I'll go ahead and add that table and I'll go ahead and close the Show Table window. Next I'll add in a couple of columns for reference. I'll double click on first name, double click on last name, and we'll scroll down and double click on the hire date column. In the next column I want to find out how long my employees have been working with the company. I'm going to right click in this fourth empty column and go down and launch the expression builder. In order to calculate an employee's tenure, we can use that age function that we created a moment…

Contents