--- title: "WEEKDAY(A)" slug: "engineeringdatefunction2-18" updated: 2021-10-15T16:12:19Z published: 2021-10-15T16:12:19Z canonical: "docs.datajet.app/engineeringdatefunction2-18" --- > ## 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. # WEEKDAY(A) ## Date Transform: WEEKDAY(A) ## Returns the weekday from Date A as an integer from 1 to 7, where 1=Monday ## Purpose Use this function to: - Create Date/Weekday mappings for use in mathematical formulas - Group events into weekdays ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 1...7 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/WEEKDAY_Sample(1).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”: “WEEKDAY(A)” | WEEKDAY(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 weekday *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/WEEKDAY_JSON.PNG) ## Usage Notes See also: - [SWEEKDAY(A)](/v1/docs/engineeringdatefunction2-17) - weekday as a string - [SMONTH(A)](/v1/docs/engineeringdatefunction2-16) - month as a string - WOY(A) - week of year ## Example | Example | Details | | --- | --- | | **Description** | Group transactions by weekday of shipment | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = WEEKDAY(A)** - A:= [transactions].[dtShipping] - Name: =ShippingWeekdayAsInt | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/WEEKDAY_Example.PNG) |