← dateadd operator page · time/dateadd/sc_date/one_month_later

One month later 🟢 all ok

pandas ✅ · DuckDB ✅

Tests:

dateadd(SC_1, 1, "M") with SC_1 = 2020-02-10: the date is an input scalar, as VTL has no date literal, and the period indicator a string, as in Manual example 1.

Manual:

Add time unit to date: "adding months to a given date returns the date plus integer months", and "dateadd (2020-02-10, 1, “M”) gives 2020-03-10".

Expected:

DS_r = 2020-03-10, a Date.

script.vtl ⇩

DS_r := dateadd(SC_1, 1, "M");

input/scalars.csv ⇩

SC_1
2020-02-10

input/scalars.json ⇩

{
  "scalars": [
    {"name": "SC_1", "type": "Date"}
  ]
}

expected/scalars.json ⇩

{
  "scalars": [
    {"name": "DS_r", "type": "Date", "value": "2020-03-10"}
  ]
}