% (Modulo) (SSIS Expressions)
Provides the integer remainder after dividing the first numeric expression by the second one.
Determined by data types of the two arguments. For more information, see Implicit Data Type Conversion in Expressions.
This example computes the modulus from two numeric literals. The result is 3.
42 % 13
This example computes the modulus from the SalesQuota column and a numeric literal.
SalesQuota % 12
This example computes the modulus from two numeric variables Sales$ and Month. The variable Sales$ must be enclosed in brackets because the name includes the $ character. For more information, see Identifiers (SSIS Expressions).
@[Sales$] % @Month
This example uses the modulo operator to determine if the value of the Value variable is even or odd, and uses the conditional operator to return a string that describes the result. For more information, see ? : (Conditional) (SSIS Expressions).
@Value % 2 == 0? "even":"odd"