


In the example above, the iif function will return "Yes" if both the ContactTitle = "Owner" and City = "Madrid". Question: How would I use the iif function if I wanted to have more than one condition?Īnswer: You could use the AND keyword to include multiple conditions.

The results of the iif function will be displayed it in a column called Hours. If is greater than 12 o'clock noon, then the iif function will subtract 30 minutes from the time worked. In this example, if the field is less than or equal to 12 o'clock noon, then the iif function will return the number of hours that have elapsed between and. You can use the iif function in a query in Microsoft Access. This is equivalent to the following IF statement in VBA code. This example would return "large" if the value in the Qty field is greater than 10. Let's look at how to use the iif function in MS Access: iif ( > 10, "large", "small") The iif function can be used in the following versions of Microsoft Access: The iif function returns value_if_false when the condition is FALSE. The iif function returns value_if_true when the condition is TRUE.

value_if_false The value that is return if condition evaluates to FALSE. value_if_true The value that is returned if condition evaluates to TRUE. The syntax for the iif function in MS Access is: iif ( condition, value_if_true, value_if_false ) Parameters or Arguments condition The value that you want to test. The Microsoft Access iif function returns one value if a specified condition evaluates to TRUE, or another value if it evaluates to FALSE. This MSAccess tutorial explains how to use the Access iif function with syntax and examples.
