By MOD(), I persume you mean that you want to return a remainder.
You can do this in SQL by using the % operator.
This example is from BOL .....
This example returns the book title number and any modulo (remainder) of dividing the price (converted to an integer value) of each book into the total yearly sales (ytd_sales * price).
USE pubs
GO
SELECT title_id,
CAST((ytd_sales * price) AS int) %CAST(price AS int) AS Modulo
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.