TO_DAY_OF_WEEK (Lakehouse v1)
Converts a date or date with time (timestamp/datetime) to a UInt8 number containing the number of the day of the week (Monday is 1, and Sunday is 7).
Analyze Syntax
Section titled “Analyze Syntax”func.to_day_of_week(<expr>)Analyze Examples
Section titled “Analyze Examples”func.to_day_of_week('2023-11-12 09:38:18.165575')
┌────────────────────────────────────────────────────┐│ func.to_day_of_week('2023-11-12 09:38:18.165575') ││ UInt8 │├────────────────────────────────────────────────────┤│ 7 │└────────────────────────────────────────────────────┘SQL Syntax
Section titled “SQL Syntax”TO_DAY_OF_WEEK(<expr>)Arguments
Section titled “Arguments”| Arguments | Description |
|---|---|
<expr> | date/timestamp |
Return Type
Section titled “Return Type”“TINYINT`
SQL Examples
Section titled “SQL Examples”SELECT to_day_of_week('2023-11-12 09:38:18.165575')
┌──────────────────────────────────────────────┐│ to_day_of_week('2023-11-12 09:38:18.165575') ││ UInt8 │├──────────────────────────────────────────────┤│ 7 │└──────────────────────────────────────────────┘