/= (Division Assignment)
compound assignment /= (Division Assignment)
What changes
- Input
- target value and an expression
- Output or change
- the same variable or column
- Return type
- Returns the data type of the argument with the higher precedence. For more information, see Data type precedence.
Syntax at a glance
expression /= expression
Work example
A ratio needs a deliberate numeric type and a zero-denominator rule.
Run the arithmetic sample. Compare integer and decimal operands, then guard a zero denominator with NULLIF where appropriate.
Check your work /= (Division Assignment). Integer division and decimal division produce the expected scales and no divide-by-zero error occurs.
Open Microsoft Learn for full syntax, permissions, and details for your version.