---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/generate-series-time.md
cuppy_section: docs
cuppy_doc: GYPY-7JDV
cuppy_doc_uuid: e78cb332-0234-4aed-bb3d-b70af13447b9
cuppy_permalink: https://cuppy.io/salesforce/d/GYPY-7JDV
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/generate-series-time
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 57ce9d494ee55a8669657029bc71e1734111909c34bb4da513446dc09a1f8b15
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/generate-series-time.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## `generate_series` (Time-based)

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Generate a series of time-based values, from `start` to `stop` with a given `step` size.

*   `<start>`: The start value of the series. Can be of type `DATE`, `TIMESTAMP`, or `TIMESTAMP WITH TIME ZONE`.
*   `<stop>`: The end value of the series. Must be of the same type as `<start>`.
*   `<step>`: The step size as an `INTERVAL`. Unlike the numerical version of `generate_series`, the step size is always required for time-based series.

Returns a set of rows, where each row has a single column, containing the generated series of values.

There are two versions of `generate_series`:

*   The numerical version
*   The time-based version

This page describes the time-based version. The numerical version is described in the [generate_series (Numerical)](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/generate-series.html) section. In contrast to the numerical version, the step size is always required for time-based series.

Furthermore, all considerations from the [generate_series (Numerical)](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/generate-series.html) section regarding `start`, `stop`, and `step` parameters apply to the time-based version, too.

Generate a series of months between two dates.

Results:

| generate_series |
| --- |
| 2017-01-01 |
| 2017-02-01 |
| 2017-03-01 |

Results:

| generate_series |
| --- |
| 2017-01-01 01:02:03 |
| 2017-02-01 01:02:03 |
| 2017-03-01 01:02:03 |

If the series starts near the end of a month, `generate_series` adjusts to the end of subsequent months.

Results:

| generate_series |
| --- |
| 2017-01-30 00:00:00 |
| 2017-02-28 00:00:00 |
| 2017-03-30 00:00:00 |
| 2017-04-30 00:00:00 |
| 2017-05-30 00:00:00 |

For negative step sizes, the function returns the series in reverse order. `start` must be greater than `stop` in this case.

Results:

| generate_series | ordinality |
| --- | --- |
| 2017-03-01 00:00:00 | 1 |
| 2017-02-01 00:00:00 | 2 |
| 2017-01-01 00:00:00 | 3 |

*   [Set Returning Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/set-returning-functions.html)
*   [`generate_series` (Numerical)](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/generate-series.html) - the numerical version of this function
*   [`ARRAY_GENERATE_SERIES` (Time-based)](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/array-generate-series-time.html) - the array-returning version of this function


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
