QDS Functions and Expressions

Functions and expressions for use in QDS Automatic Variables

Function

Description

IF (Expr, Num1, Num2, Num3) Num1 if Expr is TRUE, Num2 if FALSE, Num3 if MAYBE
IF (Expr, Num1, Num2) Same as IF(Expr, Num1, Num2, Num2)
CONCAT(Str1, Str2) Concatenation of Strings Str1 and Str2
SUBSTRING(Str, Skip, Len) Substring of the string specified

LENGTH(String)

Length (number of characters) in String

TRUNCATE (Numeric)

Integer portion of numeric value

RANDOM (Minimum value, Maximum value)

Random integer between minimum and maximum value

ROUND(numeric expression or numeric variable)

Rounded value of the function argument

STRINGTONUMBER(string expression or text variable)

Numeric value of the function argument

DATEYMD (Year, Month, Day)

Date value

TIMEHMS (Hour, Minute, Second)

Time value

LONGDATE(Date)

Long date format such as: Tuesday, August 31, 1988

SHORTDATE(Date)

Short date format such as: 08/31/1988

DAY(numeric expression or numeric variable)

Numeric value of day component

MONTH(numeric expression or numeric variable)

Numeric value of month component

YEAR(numeric expression or numeric variable)

Numeric value of year component

AGE (DoB, Date)

Age

BOTTOM(Numeric)

Lower bound of numeric value

TOP(Numeric)

Upper bound of numeric value

MIDDLE (Numeric)

Midpoint of numeric value, rounding down (same as MIDLOW)

MIDLOW (Numeric)

Midpoint of numeric value, rounding down

MIDHIGH (Numeric)

Midpoint of numeric value, rounding up

DBCOUNT (Str1, Str2, Str3)

Database lookup

DBSTATUS(Str1, Str2, Str3, Str4)

Database lookup operation that returns message if an error is found

DBVALUE (Str1, Str2, Str3, Str4)

Count of Database matches