Export (0) Print
Expand All
1 out of 2 rated this helpful - Rate this topic

% (Modulo)

SQL Server 2000

Provides the remainder of one number divided by another.

dividend % divisor
Is the numeric expression to divide. dividend must be any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of the integer data type category.
Is the numeric expression to divide the dividend by. divisor must be any valid SQL Server expression of any of the data types of the integer data type category.
Result Types



The following example uses modulo to identify employees in the Northwind database with even-numbered EmployeeID values.

SELECT EmployeeID, LastName, EmployeeID % 2 FROM Employees WHERE EmployeeID % 2 = '0'

This is the result set:

EmployeeID   LastName   #2
----------   --------   ---
2            Fuller     0
4            Peacock    0
6            Suyama     0
8            Callahan   0

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.