Skip to content

Use Dummy Zero Date

Must dummy zero dates be used for the data columns of the table?

Supported By

  • SQL Drivers (SQL Server, DB2, and ODBC)

Value

  • YES
  • NO

Associated Attribute

Remarks

This attribute indicates if dummy zero dates must be used for date columns that do not allow null values. The setting has no effect on date columns that allow null values. When set to YES, the driver will translate the DataFlex zero date to the dummy zero date value as follows:

  • SQL Server: 0001-01-01
  • DB2: 0001-01-01
  • ODBC: 0001-01-01

The underlying data type may influence the value effectively saved to the column when USE_DUMMY_ZERO_DATE is YES and a date column is left blank.

For example, in MSSQL, the range for date data types is different:

  • DateTime2: 0001-01-01 through 9999-12-31
  • Date: 0001-01-01 through 9999-12-31
  • DateTime (obsolete): January 1, 1753, through December 31, 9999

In that case, if a Date/DateTime2 column is left blank and USE_DUMMY_ZERO_DATE is YES, 0001-01-01 will be saved to the column. However, if the column type is DateTime (obsolete), 1753-01-01 will be saved to it.

Default values set in the driver INT file (MSSQLDRV.INT, DB2_DRV.INT, ODBC_DRV.INT) or in the column (backend table structure) will be ignored. The minimum value accepted by the data type will be saved if USE_DUMMY_ZERO_DATE is YES and Date/DateTime2 columns are left blank. Those defaults will only be applied if USE_DUMMY_ZERO_DATE is NO.

This avoids problems that can arise with sorting on indexes that use the date columns.

The DataFlex ODBC Driver allows the dummy zero data value to be set up in the configuration file.

For more information, see NULL Values and Defaults.

See Also