ADD()
All functions > DATE AND TIME > ADD()
Returns the date/timestamp after adding an interval.
Signatures
Temporal addition
Returns: Timestamp after adding the interval
ADD(timestamp: TIMESTAMP, interval: INTERVAL) → TIMESTAMP sql
| Parameter | Type | Required | Description |
|---|---|---|---|
timestamp | TIMESTAMP | Yes | Timestamp to add to |
interval | INTERVAL | Yes | Interval to add |
Signature notes:
- Supports adding intervals to dates and timestamps
- Returns NULL if either operand is NULL
Related operators
Examples
ADD(...)
FeatureQL
SELECT
f1 := ADD(1, 2) -- Function call
;Result
| f1 BIGINT |
|---|
| 3 |
.ADD(...) — chained
FeatureQL
SELECT
f1 := (1).ADD(2), -- Integer literal: wrap in parentheses so `.ADD` applies to the value, not to the digit sequence
f2 := 1.0.ADD(2), -- Decimal base: chain without extra parentheses
f3 := (1).ADD(2).ADD(3) -- Fold left via chained `.ADD`
;Result
| f1 BIGINT | f2 VARCHAR | f3 BIGINT |
|---|---|---|
| 3 | 3.0 | 6 |
Date and time
FeatureQL
SELECT
f1 := TIMESTAMP '2021-01-01'.ADD(INTERVAL '1 DAY'), -- Chained add on a timestamp
f2 := TIMESTAMP '2025-09-01 12:00:00'.ADD(INTERVAL_PARSE('2 hours 30 minutes')) -- Parsed duration
;Result
| f1 TIMESTAMP | f2 TIMESTAMP |
|---|---|
| 2021-01-02T00:00:00 | 2025-09-01T14:30:00 |
Edge cases
FeatureQL
SELECT
f1 := ADD(1.0, 2.0), -- DECIMAL addition
f2 := ADD(1E0, 2E0), -- DOUBLE addition
f3 := ADD(10, -3) -- Negative right operand
;Result
| f1 VARCHAR | f2 VARCHAR | f3 BIGINT |
|---|---|---|
| 3.0 | 3.0 | 7 |