{{sidenavigation.sidenavigationExpandLabel}}
{{getMsg('Help_YouAreHere')}}: {{page.title}} {{page.title}}
{{$root.getMsg("downLoadHelpAsPdf")}} {{helpModel.downloadHelpPdfDataStatus}}

Operator "-"

This operator subtracts the second operand from the first and returns the result. Depending on the value types of the two operands, the value type of the result can be the same as one of the two operands or even a completely different value type, as in the case of a date minus a time, which returns a datetime.

Note the special meaning of the "-" operator in connection with dates:

  • date - number is equivalent to subtracting a certain number of days from the date (very similar to the DateAdd function with a negative parameter)
  • datetime - number is also equivalent to subtracting a certain number of days to the date (very similar to the DateAdd function with a negative parameter)
  • time - number is equivalent to subtracting a certain number of seconds from the time (similar to the DateAdd function using a negative number of seconds as the parameter)

Usage:

number1 - number2  // Returns number
number - currency  // Returns currency
time - number      // Returns time
date - number      // Returns date
datetime - number  // Returns datetime
time - number      // Returns time

Returns:

depends on operand value types

Examples (Same in Basic and Crystal syntax):

21 - 21                         // Returns 0
21 - $21                        // Returns $0
time(12,00,00) - 73             // Returns 11:58:47
date(2005,12,12) - 42           // Returns 10/31/2005
datetime(2005,12,12,5,5,5) - 42	// Returns 10/31/2005, 5:05:05 a.m.

See also:

i-net Clear Reports
This application uses cookies to allow login. By continuing to use this application, you agree to the use of cookies.


Help - Subtract operator