DateTime

Description

When you update data in the DataWindow painter, PocketBuilder builds a SQL UPDATE statement in the background. The DateTime DBParm parameter determines how PocketBuilder specifies a DateTime datatype when it builds the SQL UPDATE statement. (A DateTime datatype contains both a date value and a time value.)

Applies to

Syntax

The syntax you use to specify the DateTime DBParm differs slightly depending on the database.

The Database Profile Setup dialog box inserts special characters (quotes and backslashes) where needed, so you can specify just the DateTime format.

In a PocketBuilder application script, you must use the following syntax. PocketBuilder parses the backslash followed by two single quotes (\'') as a single quote when it builds the SQL UPDATE statement.

DateTime = ' \''DateTime_format\'' '

Parameter

Description

'\ ''

Type a single quote, followed by one space, followed by a backslash, followed by two single quotes. There is no space between the two single quotes and the beginning of the DateTime format.

DateTime_format

The DateTime format you want PocketBuilder to use when it builds a SQL UPDATE statement to update a data source in the painter.

For more on display formats, see the Users Guide.

\'' '

Type a backslash, followed by two single quotes, followed by one space, followed by a single quote. There is no space between the end of the date format and the backslash.

Default

If no value is specified for the DateTime DBParm parameter, PocketBuilder looks for a DateTime format in the section for your ODBC driver in the pkodb25 initialization file. If no DateTime format is found in the initialization file, PocketBuilder uses the ODBC DateTime format escape sequence.

Examples

Example 1

Assume you are updating a table named Files by setting the Timestamp column to 4/2/07 3:45 pm. This DateTime is represented by the following DateTime format. To specify that PocketBuilder should use this format for the DateTime datatype when it builds the SQL UPDATE statement:

What happens PocketBuilder builds the following SQL UPDATE statement to update the table:

UPDATE FILES
SET TIMESTAMP = '4/2/07 3:45 pm'

See also