Minus Operator

The "-" operator covers multiple operations:

  • subtraction of numbers
  • offsetting of dates/times
  • calculation of the interval between dates/times

The type of operation is determined by the types of operands:

ExpressionResult
number - rightNumerical: right is converted into a numerical value, as needed.
date1 - date2Numerical: returns the interval between the two dates, expressed as fractions of days.
date - rightDate: the date is shifted by a number of days (or fraction thereof).
right is converted into its numerical representation, as needed.

Examples

4 - 2 = 2
4 - "1" = 3
Now() - 1 = 03/12/2010 12:00 when calculated at 12:00 on 03/13/2010
Now() - 1.5 = 03/12/2010 6:00 when calculated at 18:00 on 03/13/2010
dt1 - dt2 = 1.5 when dt1 is 03/13/2010 18:00 and dt2 is 03/12/2010 6:00