--- title: "ABSDAYSDIFF(A,B)" slug: "engineeringdatefunction2" updated: 2021-10-14T16:40:46Z published: 2021-10-14T16:40:46Z canonical: "docs.datajet.app/engineeringdatefunction2" --- > ## 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. # ABSDAYSDIFF(A,B) ## Date Transform: ABSDAYSDIFF(A,B) ## Returns absolute difference in days between 2 dates. ## Purpose Use this function to: - Calculate the number of days between 2 dates ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low / Med / High | | **DataType** | Discrete | | **DataSize** | Short / Integer | ```shell Example Return Value: 0...N where N = maximum days difference between the 2 dates ``` ## 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”: “ABSDAYSDIFF(A,B)” | **ABSDAYSDIFF(A,B)** | | **A** | “p2”: “DateFieldLower” | Required. Valid Inputs: Date Field, DateTime Field The lower bound date field. The order in which date fields A and B are specified does not matter. | | **B** | “p3”: “DateFieldHigher” | Required. Valid Inputs: Date Field, DateTime Field The upper bound date field. The order in which date fields A and B are specified does not matter. | ## JSON Sample ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AbsDateDiff_JSON.PNG) ## Usage Notes The order in which the date fields for parameters A and B are specified does not matter. ## Example | Example | Details | | --- | --- | | **Description** | Calculate number of days between this transaction and last transaction | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = ABSDAYSDIFF(A,B)** - A:= [transactions].[last_response] - B: = [transactions].[first_transaction] - Name: = AgeOfTransaction | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AbsDateDiff_Sample1.PNG) |