TO_DAYS
Introduced or updated: v1.2.677
Converts a specified number of days into an Interval type.
- Accepts positive integers, zero, and negative integers as input.
Syntax
TO_DAYS(<days>)
Return Type
Interval (represented in days).
Examples
SELECT TO_DAYS(2), TO_DAYS(0), TO_DAYS(-2);
┌────────────────────────────────────────┐
│ to_days(2) │ to_days(0) │ to_days(- 2) │
├────────────┼────────────┼──────────────┤
│ 2 days │ 00:00:00 │ -2 days │
└────────────────────────────────────────┘