Progress
Embedded SQL-92
Guide and Reference


DATE Data Type

The DATE data type corresponds to a date value with three parts: day-of-month, month, and year. The database representation is a long integer. The host language representation is equivalent to the following C Language structure:

typedef struct {
     short  year ;
     unsigned char month ;
     unsigned char day ;
} tpe_date_t ; 

The year range is 1 to 9999. The month range is 1 to 12. The lower limit for the day is 1, and the upper limit depends on the month and the year.

EXAMPLES

The following examples show how to use the DATE data type:

EXEC SQL BEGIN DECLARE SECTION ;
DATE date_v ;
EXEC SQL END DECLARE SECTION ;
 
EXEC SQL
     SELECT order_date
     INTO :date_v
     FROM orders
     WHERE cust_no = 2002 ; 

You can use the DATE data type in a WHERE clause, as shown:

WHERE order_date = :date_v ; 

Some of the scalar functions available for manipulating date values are ADD_MONTHS, MONTHS_BETWEEN, and TO_DATE. See Chapter 4, “SQL-92 Functions,” in the Progress SQL-92 Guide and Reference for additional information on scalar functions.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095