
Chapter 3 Defining rules and queries 49
Defining rules
hour(timestamp)
(where timestamp is a
constant, field name,
or function)
function|hour
($createdate$
)
(if
$createdate$ is set to
Friday, August 3, 2007
12:15:00 a.m.)
Returns the hour of the time stamp
(0 to 23):
12
left(string,long)
(where string and
long are constants,
field names, or
functions)
function|left("Dana",2)
Returns the left-most bytes of a
character string up to the number
of bytes indicated:
Da
length(string)
(where string is a
constant, field name,
or function)
Example 1:
function|length("Dana")
Example 2 (values in
database field
char1 for five
records):
fantastic
africa
ice
liver
rice
function|length
($char1$)
Returns the length of a character
string.
Example 1:
4
Example 2:
9
6
3
5
4
lower(string)
(where string is a
constant, field name,
or function)
function|lower("EIE")
Converts a character string to
lowercase:
eie
lpad(string,long,
string)
(where string and
long are constants,
field names, or
functions)
function|lpad("ABC",10,
"LEAD000000")
Returns the value that results from
padding the character string to the
left with another string, to a
specified length:
LEAD000ABC
ltrim(string
)
(where
string is a
constant, field name,
or function)
function|ltrim(" abc")
Strips any leading blanks from a
character string:
abc
max(any,any,any,
...)
max($field$,$field
2$, ...)
(where any is a
constant, field name,
or function)
function|max(15, 3, 7)
Returns the maximum value from
a set of values (all must be the same
data type):
15
All data types are supported.
These can be field references or
constants. Any
non-null value (positive or
negative) is greater than null.
Table 3-4: Function syntax examples
Function Example Results