graphic1

Create a Logical Expression

In Microsoft Access a Logical function compares two statements and chooses one answer. The Logical function in Access begins with IIF.

 

If you subtract the movie rental:
(Left([Description],1)

from the days rented
DateDiff("d",[DateRented],Now())

and that amount is greater than the days rented, then it's, “Not Overdue.”

If the amount is not greater, then it's, “Overdue.”
 

6. Try it: Create a Logical Expression

Click on a blank Field in the QBE Grid.
Right click to Zoom. Enter the Expression:

 

Overdue: IIf(Left([Description],1)>DateDiff("d", [DateRented],Now()),"Not Overdue","Overdue")

 

Click OK.

Keep going...

Exam 77-424: Microsoft Access 2013
3.0 Create Queries
3.3 Utilize Calculated Fields and Grouping Within a Query: Use Comparison Operators (IIF)

Query Tools ->Design

graphic2