7.1
2013-09-23

IF

This function manipulates the database output without changing the content. Its purpose is to make a conditional selection from the database.

Syntax

IF(Logical test, Value if True, Value if False)

Description

Gives one of two results depending on a condition you specify. Returns <Value if True> when <Logical test> is True, and <Value if False> otherwise.

Example

IF([GENDER]="M", "Mr.", "Mrs.")

In this example, the IF function checks the database field [GENDER], if it contains "M", it returns the string "Mr.". If the database field contains anything else, it returns "Mrs".

Parameter description

Logical test

Logical expression that determines which of the 2 parameters values will be returned.

Value if True

Any expression of fieldname. Will be returned if test condition evaluates to True.

Value if False

Any expression of fieldname. Will be returned if test condition evaluates to False.

You can use the IF function, for example, to create a salutation. See "Inserting a Salutation".