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

# quarters_sub

> Subtracts a specified number of quarters from the date.

Subtracts a specified number of quarters from the date. One quarter equals three months.

## Syntax

```Haskell theme={null}
DATETIME quarters_sub(DATETIME expr1, INT expr2);
```

## Parameters

* `expr1`: the specified date. It must be of the DATETIME or DATE type.

* `expr2`: the quarters to subtract. It must be of the INT type. It can be greater, equal, or less than zero. A negative value adds quarters to `expr1`.

## Return value

Returns a DATETIME value.

## Examples

```Plain theme={null}
select quarters_sub('2022-02-28 15:04:05', 1);
+----------------------------------------+
| quarters_sub('2022-02-28 15:04:05', 1) |
+----------------------------------------+
| 2021-11-28 15:04:05                    |
+----------------------------------------+

select quarters_sub('2022-02-28', 1);
+-------------------------------+
| quarters_sub('2022-02-28', 1) |
+-------------------------------+
| 2021-11-28 00:00:00           |
+-------------------------------+
```


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