DiffDays
4 min
this function uses the whole interval method to calculate the difference in days if you need to calculate the number of days using the boundary crossing method, use the datediffsql docid\ fj1arqgi0 ebta6hctp3e function instead see date functions docid\ kqs 9orcyllvh63bboyqv for more information about using the whole interval method versus using the boundary crossing method syntax diffdays(startdatetime, enddatetime, timezone) enabled for for a description of the business object categories, see notes on "enabled for" docid\ u26v9fecfs6ilwa0 pvjd business object category yes/no business rules before save rules yes business rules calculation rules (after save, with or without also recalculate on load) yes business rules calculation rules (before save or always, without also recalculate on load) yes business rules calculation rules (before save or always, with recalculate on load) yes business rules editing rules yes business rules initialization rules yes business rules read only rules yes business rules required rules yes business rules validation rules yes client expressions yes object permissions yes services yes ldap yes mobile yes quick actions (except ui quick actions) yes ui quick actions yes reports yes search/dashboard without field references yes search/dashboard with field references yes parameters parameter description startdatetime the start date and time to be compared enddatetime the end date and time to be compared timezone (optional) the time zone, in iana format this parameter is optional if you specify a time zone, the application assigns that time zone to both the startdatetime and enddatetime parameters if you do not specify a time zone, the application uses the time zone associated with the current session returns value number value if the value of the startdatetime parameter is earlier than the value of the enddatetime parameter, the returned value is positive if the value of the startdatetime parameter is later than the value of the enddatetime parameter, the returned value is negative example to prevent an incident from being updated after 60 days from the time it was created, you could create a read only rule with the following $(status == "closed" || diffdays(createddatetime, currentdatetime())<60) all incidents that are either closed or are more than 60 days old, become read only
