--- title: "YEAR(A)" slug: "engineeringdatefunction2-21" updated: 2021-10-16T09:40:32Z published: 2021-10-16T09:40:32Z canonical: "docs.datajet.app/engineeringdatefunction2-21" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # YEAR(A) ## Date Transform: YEAR(A) ## Returns the year portion of Date A in the format YYYY ## Purpose Use this function to: - Extract the year portion from a date - Extract the year portion from a time-stamp ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 2019, 2020,1974... ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/YEAR_Sample.PNG) ## Parameters | Parameter | JSON | Description | | --- | --- | --- | | **Table** | “targetTable”: “MyTableName” | The target table on which the new field will be created | | **Filter** | “dataset”: {DataSet_JSON} | Optional. If a filter is applied, records not in the filter Recordset will be returned as null. | | **Date Function** | “p1”: “YEAR(A)” | YEAR(A) | | **A** | “p2”: “DateTimeFieldName” “p2”: “DateFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” “p2”: “#YYYY-MM-DD” | Required. The date from which to extract the year *Supports:* - **DataType:** Discrete / Continuous - **Field Type:** Date, DateTime - **Fixed Value:** #YYYY-MM-DD, e.g. #2021-04-05 - **Fixed Value:** #YYYY-MM-DD HH:MM:SS, e.g. #2021-04-05 11:01:08 | ## JSON Sample ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/YEAR_JSON.PNG) ## Usage Notes See also: - YEARMONTH(A) - year and month in format YYYYMM - YEARQTR(A) - year and quarter in format YYYYQ - YEARWOY(A) - year and week of year, in format YYYYWW ## Example | Example | Details | | --- | --- | | **Description** | Create year field to apply as a filter | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = YEAR(A)** - A:= [transactions].[date] - Name: = YearOfDate | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/YEAR_Example.PNG) |