Arithmetic operators

Adaptive Server uses these arithmetic operators:

Table 1-2: Arithmetic operators

Operator

Meaning

+

Addition

Subtraction

*

Multiplication

/

Division

%

Modulo (Transact-SQL extension)

You can use addition, subtraction, division, and multiplication on exact numeric, approximate numeric, and money type columns.

Reviewers   Author comment:  numeric added re CR 315018 4/17/03, rjoly

You cannot use the modulo operator on smallmoney, money, float, numeric, or real columns. Modulo finds the integer remainder after a division involving two whole numbers. For example, 21% 11 = 10 because 21 divided by 11 equals 1 with a remainder of 10.

When you perform arithmetic operations on mixed datatypes (for example, float and int) Adaptive Server follows specific rules for determining the type of the result. See Chapter 7, “Using and Creating Datatypes,” for more information.