DAYSDIFF(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
DAYSDIFF(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Date Transform: DAYSDIFF(A,B)
Returns the number of days difference between two dates, where A is taken away from B
DAYSDIFF(A,B) = B - A
Purpose
Use this function to calculate:
- The number of days between two dates
- The elapsed time in days between two time-stamps
- The amount of time between an event and a specific date
Return Value
Property | Value |
---|---|
FieldType | Integer |
FieldSize | Med |
DataType | Discrete |
DataSize | Short |
Example Return Value: -N to N
where
N is the maximum difference between dates for any individual record
N is an integer
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”: “DAYSDIFF(A,B)” | DAYSDIFF(A,B) |
A | “p2”: “DateTimeFieldName” “p2”: “DateFieldName” “p2”: “#YYYY-MM-DD HH:MM:SS” “p2”: “#YYYY-MM-DD” | Required. Date to subtract from B. Supports:
|
B | “p3”: “DateTimeFieldName” “p3”: “DateFieldName” “p3”: “#YYYY-MM-DD HH:MM:SS” “p3”: “#YYYY-MM-DD” | Required. Comparator Date. Supports:
|
JSON Sample
Usage Notes
The order in which fields A and B are specified will affect the value of DAYSDIFF(A,B)
See also ABSDAYSDIFF(A,B)
Example
Example | Details |
---|---|
Description | Calculate the number of days between Purchase and Shipping |
Input |
|
Sample |
Was this article helpful?