DateTimeFormat

Description

When you update data in the DataWindow painter, DataWindow Designer builds a SQL UPDATE statement in the background. The DateTimeFormat parameter determines how DataWindow Designer 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

DateTimeFormat = 'datetime_format '

Parameter

Description

datetime_format

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

For more on display formats, see the User’s Guide.

Default

If no value is specified for the DateTimeFormat parameter, DataWindow Designer does not use a datetime datatype.

Usage

When you call stored procedures, the database server might not accept the DateTime format built by DataWindow Designer. If this occurs, you can try to use another format. For example, for Microsoft SQL Server, try this format:

DateTimeFormat='\''yyyy-mm-dd hh:mm:ss.fff\'''

Examples

Example 1

Assume you are updating a table named Files by setting the Timestamp column to 4/2/06 3:45 pm. This DateTime is represented by the following DateTime format:

m/d/yy h:mm am/pm

To specify that DataWindow Designer should use this format for the DateTime datatype when it builds the SQL UPDATE statement:

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

UPDATE FILES

SET TIMESTAMP = '4/2/06 3:45 pm'

See also