---
title: "to_weeks function in Strata | Oplema"
description: "Turn a number into a week interval for date math, so that 5 becomes 35 days. Write it as to_weeks(integer) in a Strata Formula or Filter."
url: "https://oplema.com/docs/strata/functions/to-weeks"
updated: "2026-11-04"
---

# to\_weeks

Turn a number into an interval of that many weeks, shown in days.

## Try an expression

In [Formula](https://oplema.com/docs/strata/prep/formula), enter the expression and set Output type to **VARCHAR**.

### Expression

```
to_weeks(5)
```

### Result

```
'35 days'
```

The expression returns `INTERVAL`. Formula stores it as `VARCHAR` in this example. To use your own data, replace the example values with column names. Keep format strings and other options as written.

Try it live in Formula

Result
| id | result |
| --- | --- |
| 1 | 35 days |

## Arguments and types

```
to_weeks(integer)
```

**integer**

Number

Supported signatures (2)

```
to_weeks(integer: BIGINT) → INTERVAL
to_weeks(integer: INTEGER) → INTERVAL
```

The result type can depend on the input types. See DuckDB for the full argument rules.

## Things to know

If the first argument is missing, the result is NULL.

## Related functions

[to\_centuries

Construct a century interval.

](https://oplema.com/docs/strata/functions/to-centuries)[to\_days

Turn a number into an interval of that many days.

](https://oplema.com/docs/strata/functions/to-days)[to\_decades

Construct a decade interval.

](https://oplema.com/docs/strata/functions/to-decades)[to\_hours

Construct an hour interval.

](https://oplema.com/docs/strata/functions/to-hours)

[Browse dates & times](https://oplema.com/docs/strata/functions#dates-&-times) [DuckDB documentation](https://duckdb.org/docs/current/sql/functions/interval.html#to_weeksinteger)

Function metadata from DuckDB, used under the [MIT license](https://github.com/duckdb/duckdb/blob/v1.5.4/LICENSE).
