Specifying the data type
To override the default behavior and to explicitly specify the data type, a data type indicator must precede the bind value. The syntax for this is:
:bind([T|N|D],value)
The following table lists the data type indicators and the relationship between each data type indicator and the ODBC data types.
- Data Type Indicator
- ODBC data type
- T or TEXT
- SQL_CHAR
- N or NUM or NUMBER
- SQL_NUMERIC
- D or DATE
- SQL_DATETIME
For information about item formats and interpretation, see Item Type Properties.
As an example of specifying a data type, to bind a date value to a statement, you must specify that the value be of data type DATETIME. The SQL statement would be entered as:
DBLOOKUP("select Age from Person where DateOfBirth=:bind([DATE]," +
DateItem:Row + ")",
"DB.mdq",
"MyDB")
If the [DATE] data type indicator is not specified, the trace file from the adapter displays the following error message:
Message: [Microsoft][ODBC Microsoft Access 97 Driver]
Data type mismatch in criteria expression.