Adding and Subtracting Date and Time Data Types
Go Up to Working with Dates and Times
The following table shows the result of adding and subtracting DATE, TIME, TIMESTAMP, and numeric values. “Numeric value” refers to any value that can be cast as an exact numeric value by the database engine (for example, INTEGER, DECIMAL, or NUMERIC).
Operand1 | Operator | Operand2 | Result |
---|---|---|---|
|
+ |
|
Error |
|
+ |
|
|
|
+ |
|
Error |
|
+ |
Numeric value |
|
|
+ |
|
|
|
+ |
|
Error |
|
+ |
|
Error |
|
+ |
Numeric value |
|
|
+ |
|
Error |
|
+ |
|
Error |
|
+ |
|
Error |
|
+ |
Numeric value |
|
|
- |
|
|
|
- |
|
Error |
|
- |
|
Error |
|
- |
Numeric value |
|
|
- |
|
Error |
|
- |
|
|
|
- |
|
Error |
|
- |
Numeric value |
|
|
- |
|
Error |
|
- |
|
Error |
|
- |
|
|
|
- |
Numeric value |
|