--- title: "DOY(A)" slug: "engineeringdatefunction2-12" updated: 2021-10-15T10:33:19Z published: 2021-10-15T10:33:19Z canonical: "docs.datajet.app/engineeringdatefunction2-12" --- > ## 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. # DOY(A) ## Date Transform: DOY(A) ## Returns Day of Year A, where Jan 01 is 1 and Dec 31 is 365/366 ## Purpose Use this function to: - Return the number of elapsed days between A and the start of the year ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 1...366 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DOY_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. | | **DateTimeFunction** | “p1”: “DOY(A)” | DOY(A) | | **A** | “p2”: “DateTimeFieldName” “p2”: “DateFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” “p2”: “#YYYY-MM-DD” | Required. Source field or value from which to calculate the day of 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/DOY_JSON.PNG) ## Usage Notes See also MONTH(A), WOY(A) and YEAR(A) ## Example | Example | Details | | --- | --- | | **Description** | Calculate the time interval between start of year and shipping date in days | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = DOY(A)** - A:= [transactions].[dtShipping] - Name: =ShippingDayOfYear | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/DOY_Example.PNG) |