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
ParameterTypeRequiredDescription
timestampTIMESTAMPYesTimestamp to add to
intervalINTERVALYesInterval 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 BIGINTf2 VARCHARf3 BIGINT
33.06

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 TIMESTAMPf2 TIMESTAMP
2021-01-02T00:00:002025-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 VARCHARf2 VARCHARf3 BIGINT
3.03.07

Last update at: 2026/05/26 17:22:09