> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# QUARTER

> Extracts the calendar quarter from a date or timestamp.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

NULL input returns NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
quarter(value)
```

## Arguments

| Name | Type | Required | Description |
| - | - | - | - |
| value | DATE or TIMESTAMP | Yes | Value to inspect. |

## Returns

* Type: INTEGER
* Possible values: 1 through 4.
* NULL behavior: NULL input returns NULL.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Yes |

## Usage notes

* QUARTER(value) gives the same INTEGER result as EXTRACT(QUARTER FROM value).
* Deterministic: The same inputs and settings produce the same result.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT quarter(DATE '2024-03-15') AS "value";
```

| value |
| - |
| 1 |

### Quarter boundaries

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT quarter(DATE '2024-03-31') AS march, quarter(DATE '2024-04-01') AS april;
```

| march | april |
| - | - |
| 1 | 2 |

## Related functions

* [date\_part](/query/sql/functions/date-time/date_part)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.