From the course: Access 2021: Queries

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Create an IIF() function

Create an IIF() function

- We can use the expression builder tool to help construct valid conditional statements with the IIF function. First, though like with all of our queries, it will be best if we can define the question that we're trying to answer. I want to clearly identify which employees have a work anniversary this month. If the month that they were hired is these same as the current month, then the query should return a message to that effect. Otherwise, no message will be returned. We can take a look at this by creating a new query in design view and we'll pull in the Employee's table. From there I'll add in the employee ID, first name, last name, and the hire date columns. In the fifth column the empty one here to the right, I will invoke the expression builder. We can find the IIF function inside of the built-in functions. And I'll scroll down to the categories, to the program flow category, and here is IIF. The…

Contents