ANNIVERSARYDAYS(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
ANNIVERSARYDAYS(A,B)
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Date Transform: ANNIVERSARYDAYS(A,B)
Number of days between Day/Month(A) and Day/Month(B) as if A and B were both in the same year
ANNIVERSARYDAYS(A,B) = DayOfYear(B) - DayOfYear(A)
where
DayOfYear(B) = number of days between B and the start of the year B
DayOfYear(A) = number of days between A and the start of the year A
Purpose
Use this function to:
- Calculate the number of days until a specific anniversary
- Calculate the number of days past a specific anniversary
Return Value
Property | Value |
---|---|
FieldType | Integer |
FieldSize | Low |
DataType | Discrete |
DataSize | Short |
Example Return Value: -365....365
Parameters
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”: “ANNIVERSARYDAYS(A,B)” | ANNIVERSARYDAYS(A,B) |
A | “p2”: “DateField1” “p2”: “#YYYY-MM-DD” | Required. The comparative field. Supports: Date, DateTime, Fixed_Value Fixed Value = #YYYY-MM-DD e.g. #2021-04-05 |
B | “p3”: “DateField2” “p2”: “#YYYY-MM-DD” | Required. The anniversary field. Supports: Date, DateTime, Fixed_Value Fixed Value = #YYYY-MM-DD e.g. #2021-04-05 |
JSON Sample
Usage Notes
If DayOfYear(B) is before DayOfYear(A) then ANNIVERSARYDAYS(A,B) will be negative.
If DayOfYear(B) is after DayOfYear(A) then ANNIVERSARYDAYS(A,B) will be positive.
Example
Example | Details |
---|---|
Description | Days this year until anniversary of first transaction |
Input |
|
Sample |
Was this article helpful?