📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

TO_WEEKS



Converts a specified number of weeks into an Interval type.

  • Accepts positive integers, zero, and negative integers as input.

Syntax

TO_WEEKS(<weeks>)

Return Type

Interval (represented in days).

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 │ └───────────────────────────────────────────┘

Was this page helpful?