Executes commands depending on the value of a condition.
IF logical_expression
IF commands have the following structure:
Any valid logical expression. See LET for a description of logical expressions.
See Bit-Wise Operators for information on the bit-wise operators supported by IF.
The expression is evaluated as a logical TRUE or FALSE. A value or expression that evaluates to nonzero is TRUE.
Each IF must have a matching END-IF.
Comparing a date variable or column with a string, results in a date comparison (chronological, not a byte by byte comparison as is done for strings). The string must be in the proper format as follows:
For DATETIME columns and Production Reporting DATE variables, Production Reporting uses the format specified by SQR_DB_DATE_FORMAT, one of the database-dependent formats (see Table 61, Default Formats by Database), or the database-independent format 'SYYYYMMDD[HH24[MI[SS[NNNNNN]]]]'.
For DATE columns, Production Reporting uses the format specified by SQR_DB_DATE_ONLY_FORMAT. If not set, Production Reporting uses the format in Table 62, DATE Column Formats.
For TIME columns, Production Reporting uses the format specified by SQR_DB_TIME_ONLY_FORMAT. If not set, Production Reporting uses the format in Table 63, TIME Column Formats.