TO_DAYS (Lakehouse v1)
Converts a specified number of days into an Interval type.
- Accepts positive integers, zero, and negative integers as input.
Analyze Syntax
Section titled “Analyze Syntax”func.to_days(<days>)Analyze Examples
Section titled “Analyze Examples”func.to_days(2)┌──────────────────────────────────────────────────────┐│ func.to_days(2) │├──────────────────────────────────────────────────────┤│ 200 days │└──────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_DAYS(<days>)Return Type
Section titled “Return Type”Interval (represented in days).
SQL Examples
Section titled “SQL 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 │└────────────────────────────────────────┘