Skip to content

Converts a specified number of weeks into an Interval type.

  • Accepts positive integers, zero, and negative integers as input.
func.to_weeks(<weeks>)
func.to_weeks(2)
┌──────────────────────────────────────────────────────┐
│ func.to_weeks(2) │
├──────────────────────────────────────────────────────┤
14 days │
└──────────────────────────────────────────────────────┘
TO_WEEKS(<weeks>)

Interval (represented in days).

SELECT TO_WEEKS(2), TO_WEEKS(0), TO_WEEKS((- 2));
┌───────────────────────────────────────────┐
│ to_weeks(2) │ to_weeks(0) │ to_weeks(- 2) │
├─────────────┼─────────────┼───────────────┤
14 days00:00:00-14 days
└───────────────────────────────────────────┘