Wednesday, September 2, 2015

IIF Statement With Wildcard Condition In Access


Criteria :  All records where unit price is 0.99 or 1.99 or 2.99 or 3.99

Besides using the = operator in the expression for exact matches, we can also use other operators.
For example, for partial matches of text strings/numbers, we can use LIKE "*".

Credit to : http://www.access-programmers.co.uk/forums/showthread.php?p=471291#post471291


Example : Total2: IIf([Total] Like "*.99", True, False)


Criteria  : Multiple IIF in Access

Example : SWITCH (Criteria, TrueResult, Criteria2, TrueResult2, Criteria3, TrueResult3, Criteria4, TrueResult4)

 or by using Nested IIF

Example  : IIF( Criteria, TrueResult, IIF(Criteria, TrueResult, IIF(Criteria,
TrueResult, FalseResult)))
Credit to  : http://www.pcreview.co.uk/threads/multiple-if-else-in-ms-access.2789488/ 



No comments:

Post a Comment