SAND CDBMS SQL Reference Guide
Date/Time Arithmetic

 

Previous Topic:
Interval Comparisons
Chapter Index
 

 

Implicit Casting

Certain implicit type casting is performed on quoted string literals to DATE, TIME, and TIMESTAMP values, when they are part of an arithmetic expression or comparison operation. There is also implicit type casting on some numeric expressions to interval types in the same situations.

The implicit date/time type castings are the following:


Examples

Expression Result
'01:01:01' + 59 01:02:00
'1945-09-02' - '1939-09-10' 2184 (days)
'2003-12-19' - 19 2003-11-30