Calculating a MOD 10 Check Digit

Printable View

• 01-07-2003, 01:18 PM
Scott
Calculating a MOD 10 Check Digit

How do I perform a MOD calculation in SQL when the MOD operator is not available?

Scott
Example: 12 MOD 10 = 8
• 01-07-2003, 02:12 PM
Daniel Reber
Re: Calculating a MOD 10 Check Digit
copied out of BOL:

Arithmetic Operators
Arithmetic operators perform mathematical operations on two expressions of
any of the data types of the numeric data type category. For more
information about data type categories, see Transact-SQL Syntax Conventions.

Operator Meaning
+ (Add) Addition.
- (Subtract) Subtraction.
* (Multiply) Multiplication.
/ (Divide) Division.
% (Modulo) Returns the integer remainder of a division. For example,
12 % 5 = 2 because the remainder of 12 divided by 5 is 2.

Daniel Reber
Datamasters, Inc

"Scott" <sremiger@pnms.com> wrote in message
news:3e1b19fc\$1@tnews.web.devx.com...
>
> How do I perform a MOD calculation in SQL when the MOD operator is not

available?
>
> Scott
> Example: 12 MOD 10 = 8