Previous Topic: Complex Data Lookup CommandsNext Topic: Complex True-False Test


Simple True-False Tests

Simple True-False test: positive operator, IS

This example is a simple True-False test that uses the positive operator IS, in the following single lookup command:

mapi with %recipient% where dept IS "sales"

When %recipient% is used with IS in this way, the operator ANY is implicit, so the lookup command is actually as follows:

mapi with ANY %recipient% where dept IS "sales"

If there are three recipients, this command requires the following three lookup operations:

(mapi with srimmel@unipraxis.com where dept IS "sales") OR
(mapi with lsteel@unipraxis.com where dept IS "sales") OR
(mapi with fschaeffer@unipraxis.com where dept IS "sales")

For the test to be true, only one of the lookup commands needs to be true. That is, if Spencer is in the Sales department, the lookup command is true and does not check to see if Lynda and Frank are also in the Sales department.

If you want to use ALL with the same lookup command, you need to add it explicitly, as shown below:

mapi with ALL %recipient% where dept IS "sales"

With the same three recipients, this command requires the following three lookup operations:

(mapi with srimmel@unipraxis.com where dept IS "sales") AND (mapi with lsteel@unipraxis.com where dept IS "sales") AND (mapi with fschaeffer@unipraxis.com where dept IS "sales") 

This time, for the test to be true, all three lookup commands must be true. That is, Spencer, Lynda and Frank must all be in the Sales department for the test to be true.

Simple True-False test: negative operator, IS NOT

This example is a simple True-False test that uses the negative operator IS NOT, in the following single lookup command.

mapi with %recipient% where dept IS NOT "sales"

When %recipient% is used with IS NOT in this way, the operator ALL is implicit, so the lookup command is actually as follows:

mapi with ALL %recipient% where dept IS NOT "sales"

If there are three recipients, this command requires the following three lookup operations:

(mapi with srimmel@unipraxis.com where dept IS NOT "sales") AND (mapi with lsteel@unipraxis.com where dept IS NOT "sales") AND (mapi with fschaeffer@unipraxis.com where dept IS "sales") 

For the test to be true, all three lookup commands must be true. That is, Spencer, Lynda and Frank must all be in a department other than ‘Sales’ for the test to be true.

If you want to use ANY with the same lookup command, you need to add it explicitly, as shown below:

mapi with ANY %recipient% where dept IS NOT "sales"

With the same three recipients, this command requires the following three lookup operations:

(mapi with srimmel@unipraxis.com where dept IS NOT "sales") OR
(mapi with lsteel@unipraxis.com where dept IS NOT "sales") OR
(mapi with fschaeffer@unipraxis.com where dept IS "sales")

For the test to be true, only one of the lookup commands needs to be true. That is, if Spencer is not in the Sales department, then that lookup command is true and the details for Lynda and Frank are not checked.

More information:

Address Book Lookup