--- title: "AGE(A)" slug: "engineeringdatefunction2-1" updated: 2021-10-14T10:20:23Z published: 2021-10-14T10:20:23Z canonical: "docs.datajet.app/engineeringdatefunction2-1" --- > ## 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. # AGE(A) ## Date Transform: AGE(A) ## Age in years at the time the field was built Number of whole years between Date(Time) field A and today, where today is the date on which the field was built. ## Purpose Use this function to: - Calculate age of customers at the time of Data Load - Calculate transaction age in years ## Return Value | Property | Value | | --- | --- | | **FieldType** | Integer | | **FieldSize** | Low / Med | | **DataType** | Discrete | | **DataSize** | Short | ```shell Example Return Value: 0....N where N is maximum number of years between today and Field(A) ``` ## 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”: “AGE(A)” | AGE(A) | | **A** | “p2”: “DateFieldName” | Required. Date Field, or fixed value using #YYYY-MM-DD notation. If FIXED_VALUE is used, every row will have the difference in years between TODAY and FIXED_VALUE. | ## JSON Sample ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AGE_JSON_2.PNG) ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AGE_JSON_1.PNG) ## Usage Notes The values returned by AGE(A) will depend on the value of TODAY when the field is calculated, and so will change each time a load script is executed. ## Example | Example | Details | | --- | --- | | **Description** | Calculate Transaction Age in Years | | **Input** | - Table: = [transactions] - Function: = DateTransform - **DateTimeFunction: = AGE(A)** - A:= [transactions].[date] - Name: = Age | | **Sample** | ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/AGE_Example.PNG) |