days()

The days() function returns the number of days between two dates.

Syntax

days(date1, date2)

Argument Description
date1

(required)

An expression that results in a date value (i.e., a hard-coded date, a reference to a date attribute, or a function that returns a date value).
date2

(required)

An expression that results in a date value (i.e., a hard-coded date, a reference to a date attribute, or a function that returns a date value). 

This date will be subtracted from the first date argument to produce the result of the function.

Note: if either argument in this function resolves to <empty>, the returned value will be <empty>.

Where Available

Available in all places the injected expression icon is visible, as well as within Filter fields on Cards, Tables and List/View sections.

Examples

Where Example(s)
Business rules: Set Value

Attribute expression

days("2023-12-31", "2023-12-01")  

result: 30

days("2023-12-01", "2023-12-31")  

result: -30

days(Stage_2_Start__c, Stage_1_Start__c)

days(dueDate, today())

Field Editability expression

Tab Visibility expression

Business rules: Condition

LOE_Estimate__c < days(Stage_2_Start__c, Stage_1_Start__c)
Business rules: Notification Subject

Business rules: Notification Body

Dynamic Filter

{!days(Stage_2_Start__c, Stage_1_Start__c)}

{!days(due_date__c, today())}

Embedded Section URL attribute

External View URL on List/View

{!URL1__c & “/” & days(due_date__c, today())}
Metric expression sumif(Initiative__t, OPEX__m, active and LOE_Estimate__c < days(Stage_2_Start__c, Stage_1_Start__c))

 

Updated on January 29, 2024

Related Articles