Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Collapse the table of content
Expand the table of content
Expand Minimize

% (Modulo) (SQL Server Compact Edition)

Provides the remainder of one number divided by another.

dividend % divisor


The numeric expression to divide. The dividend can be any valid expression in Microsoft SQL Server 2005 Compact Edition of the integer data type category.


The numeric expression to divide the dividend by. The divisor can be any valid SQL Server expression of any of the data types of the integer data type category.

The following example uses modulo to identify employees 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            Funk     0
4            Pearson    0
6            Sutton     0
8            Calafato   0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2015 Microsoft