The weeks() function returns the number of weeks between two dates.
Syntax
weeks(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 expression or 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 |
weeks("2025-12-31", "2025-12-01")
result: 4
result: -4
|
| Field Editability expression
Tab Visibility expression Business rules: Condition |
LOE_Estimate__c < weeks(Stage_2_Start__c, Stage_1_Start__c) |
| Business rules: Notification Subject
Business rules: Notification Body Dynamic Filter |
{!weeks(Stage_2_Start__c, Stage_1_Start__c)}
|
| Embedded Section URL attribute
External View URL on List/View |
{!URL1__c & “/” & weeks(due_date__c, today())} |
| Metric expression | sumif(Initiative__t, OPEX__m, active and LOE_Estimate__c < weeks(Stage_2_Start__c, Stage_1_Start__c)) |