--- title: "YEARQTR(A)" slug: "engineeringdatefunction2-23" updated: 2021-10-16T09:57:09Z published: 2021-10-16T09:57:09Z canonical: "docs.datajet.app/engineeringdatefunction2-23" --- > ## 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. # YEARQTR(A) ## Date Transform: YEARQTR(A) ## Extract the Year and Quarter from Date A in the format YYYYQ ## Purpose Use this function to: - Segment Transaction data into yearly quarters ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Med | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 20211,20191,20203 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/YEARQTR_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”: “YEARQTR(A)” | YEARQTR(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 and the quarter *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/YEARQTR_JSON.PNG) ## Usage Notes {Insert Notes Here} ## Example | Example | Details | | --- | --- | | **Description** | Segment transaction data into yearly quarters | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = YEARQTR(A)** - A:= [transactions].[date] - Name: =YearQuarter | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/YEARQTR_Example.PNG) |