--- title: "MIN(A,B)" slug: "engineeringdatefunction2-14" updated: 2021-10-15T11:14:37Z published: 2021-10-15T11:14:37Z canonical: "docs.datajet.app/engineeringdatefunction2-14" --- > ## 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. # MIN(A,B) ## Date Transform: MIN(A,B) ## Returns the earliest of two dates ## Purpose Use this function to: - Identify which of two events occurred first ## Return Value | Property | Value | | --- | --- | | **FieldType** | Date | | **FieldSize** | | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 2021-09-08 ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/MIN_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”: “MIN(A,B)” | MIN(A,B) | | **A** | “p2”: “DateTimeFieldName” “p2”: “DateFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” “p2”: “#YYYY-MM-DD” | Required. Date formatted data. *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 | | **B** | “p3”: “DateTimeFieldName” “p3”: “DateFieldName” “p3”: “#YYYY-MM-DD HH:MM:SS” “p3”: “#YYYY-MM-DD” | Required. Date formatted data. *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/MIN_JSON.PNG) ## Usage Notes See also [MAX(A,B)](/v1/docs/engineeringdatefunction2-13) ## Example | Example | Details | | --- | --- | | **Description** | Determine which event occurred first | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = MIN(A,B)** - A:= [transactions].[dtShipping] - B: = [transactions].[dtPurchase] - Name: = EarliestContact | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/MIN_Example.PNG) |