# ISO\_YEAR\_PART\_UDF

{% hint style="info" %}
**Important Notice: Migration of Documentation Website**

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

[Official Snowflake Snowconvert Documentation](https://docs.snowflake.com/en/migrations/snowconvert-docs/general/technical-documentation/function-references/teradata/README)

For any immediate assistance or if you encounter any issues, please contact our support team at [snowconvert-support@snowflake.com](mailto:snowconvert-support@snowflake.com).

Thank you for your understanding.
{% endhint %}

## Definition

Determines the iso year from a given date truncated to the specified number of digits.

```sql
PUBLIC.ISO_YEAR_PART_UDF(INPUT TIMESTAMP_TZ, DIGITS INTEGER)
```

## Parameters

`INPUT` TIMESTAMP\_TZ

The date to take the iso year from.

`DIGITS` INTEGER

The amount of digits wanted in the result.

## Returns

Returns a `varchar` which is the iso year from a given date.

## Usage example

Input:

```sql
SELECT PUBLIC.ISO_YEAR_PART_UDF(DATE '2021-10-26', 3);
SELECT PUBLIC.ISO_YEAR_PART_UDF(DATE '2021-10-26', 2);
SELECT PUBLIC.ISO_YEAR_PART_UDF(DATE '2021-10-26', 1);
```

Output:

```sql
'021'
'21'
'1'
```
