← datediff operator page · time/datediff/sc_date/across_the_new_year
pandas ✅ · DuckDB ✅
datediff(SC_1, SC_2) of two scalar dates, SC_1 = 2020-12-14 and SC_2 = 2021-04-20, the page's valid syntax datediff (2020-12-14,2021-04-20), with the dates given in the default YYYY-MM-DD form, as VTL has no date literal.
Days between two dates: "The operator datediff returns the number of days between two dates or time periods."
DS_r = 127, an Integer: 17 days to the end of 2020, then 31, 28 (2021 is not a leap year), 31 and 20.
DS_r := datediff(SC_1, SC_2);
| SC_1 | SC_2 |
|---|---|
| 2020-12-14 | 2021-04-20 |
{
"scalars": [
{"name": "SC_1", "type": "Date"},
{"name": "SC_2", "type": "Date"}
]
}
{
"scalars": [
{"name": "DS_r", "type": "Integer", "value": 127}
]
}