# DATE_TRUNC() Function

### Description

Truncates a date or timestamp to the specified precision

### Syntax

```sql
DATE_TRUNC(datepart, date)
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _unit_ | Date or time part (for example day, month, year) | String | Yes |
| _timestamp_ | Timestamp value | Timestamp | Yes |

#### Accepted datepart values

| Datepart Name | Datepart Abbreviation |
| --- | --- |
| year | yy, yyyy |
| quarter | qq, q |
| month | mm, m |
| dayofyear | dy, y |
| day | dd, d |
| week | wk, ww |
| weekday | dw, w |
| hour | hh |
| minute | mi, n |
| second | ss, s |
| millisecond | ms |
| microsecond | mcs |
| nanosecond | ns |

### Example

```sql
SELECT
    DATE_TRUNC('month', start_date)
FROM
    rippling.employee.Employee
LIMIT
    5;
```

Source: https://developer.rippling.com/documentation/rippling-platform/transformations/sql-reference/date_trunc

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
