Reference material for IF function
IF
function is a simplified alternative to the CASE
expression for handling conditional logic.
Parameter | Description | Supported input types |
---|---|---|
<condition> | Condition that the function evaluates. | BOOLEAN |
<then> | Value returned when <condition> evaluates to true . | Any |
<else> | Value returned when <condition> evaluates to false or NULL . Must match the data type of <then> . | Any |
IF
function returns the same data type as the <then>
and <else>
parameters.
IF
function to determine if the current day is a weekend or weekday:
Weekend
when the current day is Saturday or Sunday.Weekday
for any other day.