# DATE_OF_CHANGE() Function

### Description

Calculates date of change for a given attribute

| Change Type | Description |
| --- | --- |
| FIRST | Returns the date of the first time an attribute was updated |
| LAST | Returns the date of the last time an attribute was updated |
| INDEX | Returns the date of the Nth time an attribute was updated; Positive and negative indexes are supported |

### Syntax

```sql
DATE_OF_CHANGE(expression, change_type)
```

### Parameters

| Parameter | Description | Data Type | Required |
| --- | --- | --- | --- |
| _field_ | The field argument | Any | Yes |
| _as\_of_ | The as of argument | Date or timestamp | No |

### Example

```sql
SELECT
    DATE_OF_CHANGE(salary, start_date)
FROM
    rippling.employee.Employee
LIMIT
    5;
```

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

> 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.
