ODBC and JDBC Developer’s Guide

Table Of Contents
Supported standards 39
Operator precedence
As expressions become more complex, the order in which the expressions are evaluated becomes important.
This table shows the order in which the operators are evaluated. The operators in the first line are evaluated
first, and so on. Operators in the same line are evaluated left to right in the expression.
DAYOFWEEK Returns the day of week (1-7) of a date
expression
DAYOFWEEK({05/01/2004}) returns 7
MIN Returns the smaller of two numbers MIN(66,89) returns 66
POW Raises a number to a power POW(7,2) returns 49
INT Returns the integer part of a number INT(6.4321) returns 6
X Returns the decimal equivalent of a
hexadecimal number
X'b9' returns 185
B Returns the decimal equivalent of a binary
number
B'1001' returns 9
ROUND Rounds a number ROUND(123.456,0) returns 123
ROUND(123.456,2) returns 123.46
ROUND(123.456,-2) returns 100
NUMVAL Converts a character string to a number; if
the character string is not a valid number,
returns 0
NUMVAL('123') returns 123
VAL Converts a character string to a number; if
the character string is not a valid number,
returns 0
VAL('123') returns 123
Functions that
return dates Description Example
DATE Returns today’s date If today is 11/21/2005, DATE() returns {2005-11-21}
DATEVAL Converts a character string to a date DATEVAL('01/30/2006') returns {2006-01-30}
Precedence Operator
1 Unary '-', Unary '+'
2 ^, **
3 *, /
4 +, -
5 =, <>, <, <=, >, >=, Like, Not Like, Is Null, Is Not Null, Between, In, Exists, Any, All
6 Not
7 AND
8 OR
Functions that
return numbers Description Example