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:
| Expression | Result |
number - right | Numerical: right is converted into a numerical value, as needed. |
date1 - date2 | Numerical: returns the interval between the two dates, expressed as fractions of days. |
date - right | Date: the date is shifted by a number of days (or fraction thereof).right is converted into its numerical representation, as needed. |
Examples
4 - 2 = 24 - "1" = 3Now() - 1 = 03/12/2010 12:00 when calculated at 12:00 on 03/13/2010Now() - 1.5 = 03/12/2010 6:00 when calculated at 18:00 on 03/13/2010dt1 - dt2 = 1.5 when dt1 is 03/13/2010 18:00 and dt2 is 03/12/2010 6:00