Date subtraction

Specify the - (minus) operator to calculate the number of days between two dates.

Syntax

end_date - start_date

end_date and start_date can be any of the following:

  • Another function that returns a date.
  • A formula column that returns a date.

If end_date is earlier than start_date, the function returns a negative value.

Examples

  • (date(2012, 1,10)) - (date(2012, 1,1)) returns 9
  • If today is January 1, 2015, and you have three formula columns c:"year" returning 2015, c:"month" returning 1, and c:"day" returning 15, the following function returns -14:
    today() - date(c:"year", c:"month", c:"day")
Was this article helpful?
How can we improve it?