DATE data type

Informix® supports the DATE data type to store year, month and day information:

Genero db has an equivalent type with the same name.

String representing date time information: Informix is able to convert quoted strings to DATE data, if the string formatting matches the formatting set by environment parameters (DBDATE). Genero db can also convert quoted strings to DATE; by default, date/time formats follow the ISO standard (2005-01-30).

Date arithmetic:

Solution

The Genero db DATE type is used for Informix DATE data. Arithmetic expressions involving dates (for example, to add or remove a number of days from a date) will produce the same results with Genero db as Informix.

Note:
  • Using integers (the number of days since 1899/12/31) as dates is supported by Genero db in a SELECT INTO statement but not in a WHERE clause. Check your code to detect the use of integers with DATE columns. With Informix and Genero db, a date of 1900/1/1 when selected into an INTEGER will be converted to 1.
  • It is strongly recommended that you use BDL variables in dynamic SQL statements instead of quoted strings representing DATEs. For example:

    LET stmt = "SELECT ... FROM customer WHERE create_date >'", adate,"'" is not portable. Use a question mark place holder instead and OPEN the cursor by USING a date:

    LET stmt = "SELECT ... FROM customer WHERE create_date > ?"

  • Before Genero db 3.80, DATE arithmetic expressions using SQL parameters (USING variables) are not fully supported. For example: "SELECT ... WHERE datecol < ? + 1" generates an error at PREPARE time.