TO_WEEKS (Lakehouse v1)
Converts a specified number of weeks into an Interval type.
- Accepts positive integers, zero, and negative integers as input.
Analyze Syntax
Section titled “Analyze Syntax”func.to_weeks(<weeks>)Analyze Examples
Section titled “Analyze Examples”func.to_weeks(2)┌──────────────────────────────────────────────────────┐│ func.to_weeks(2) │├──────────────────────────────────────────────────────┤│ 14 days │└──────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_WEEKS(<weeks>)Return Type
Section titled “Return Type”Interval (represented in days).
SQL Examples
Section titled “SQL Examples”SELECT TO_WEEKS(2), TO_WEEKS(0), TO_WEEKS((- 2));
┌───────────────────────────────────────────┐│ to_weeks(2) │ to_weeks(0) │ to_weeks(- 2) │├─────────────┼─────────────┼───────────────┤│ 14 days │ 00:00:00 │ -14 days │└───────────────────────────────────────────┘