Carrot reference
Operators

- (subtract)

An operator used to subtract an expression from another expression.

Syntax

valueOne - valueTwo

Sample usage

(1 - 2) - 3 returns -4

('2021-01-02') - 1 returns 2021-01-01

Supported data types

  • If a Number, Money value, or Percent is subtracted from an expression of the same type, the difference between the two values will be returned.
  • If the left side is a Date, and the right side is a Number, it will return the date minus that many days.
  • Date is subtracted from another Datethe number of days between them will be returned.
  • If a Number value is subtracted from a Money value, the Money value will decrease by the value of the Number.
  • If a Percent value is subtracted from a Number value, the Number value will decrease by the value of the Percent; the reverse operation will also work, however the returned value will still be of type Number.

See also



Updated 04 Oct 2023
Doc contributor
Did this page help you?