QODBC System Functions
CONVERT(value_exp, data_type) - The function returns the value specified by value_exp converted to the specified data_type, where data_type is one of the following keywords:
SQL_BIGINT, SQL_BINARY, SQL_BIT, SQL_CHAR, SQL_DATE, SQL_DECIMAL, SQL_DOUBLE, SQL_FLOAT, SQL_INTEGER, SQL_LONGVARBINARY, SQL_LONGVARCHAR, SQL_NUMERIC, SQL_REAL, SQL_SMALLINT, SQL_TIME, SQL_TIMESTAMP, SQL_TINYINT, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_VARBINARY, SQL_VARCHAR
Example:
SELECT ('0'+ {fn CONVERT(Id, SQL_VARCHAR)}) AS "IDString" From Company
Returns:
DATABASE() – Returns the name of the database in use at the time this function is called.
Example:
SELECT {fn DATABASE()} AS "OpenDatabase" FROM Company
Returns:
OpenDatabase
|
C:\Program Files\QODBC Driver for QuickBooks\sample_product-based.qbw
|
IFNULL(exp, value) – If exp is null, value is returned. If exp is not null, exp is returned. The possible data type(s) of value must be compatible with the data type of exp.
Example:
Select Name, {fn IFNULL(Fax, 'Missing Fax')} as "FixedFax" from Employee
Returns:
Name
|
FixedFax
|
Dan T. Miller
|
Missing Fax
|
Elizabeth N. Mason
|
480-134-1122
|
Gregg O. Schneider
|
Missing Fax
|
USER() – Returns the user’s authorization name. This value is not used by QODBC but will return the value passed in on the connection string.
Example:
SELECT {fn USER()} AS "CurUser" FROM Company
Returns:
For more functions click here. |