MOD( )
Returns the remainder after a number is divided by another.
Syntax
MOD(number, divisor)
Arguments
number
The number to divide.
divisor
Returns
The remainder after the number value is divided by the divisor value. Different applications and programming languages define the modulo operation differently when either the dividend or the divisor are negative. For example, in EasyScript and Excel, MOD(-5, 3) returns 1. However, in JavaScript and most databases, the modulo operation returns -2.
Examples
MOD(10, 5) // returns 0
MOD(11, 5) // returns 1
MOD(12, 5) // returns 2
MOD(-10, 5) //returns 0
MOD(-11, 5) //returns 4
MOD(-12, 5) //returns 3
MOD(10, -5) //returns 0
MOD(11, -5) //returns -4
MOD(12, -5) //returns -3
The following example uses MOD( ) to check if numbers in the Grade field are odd or even. When the divisor is 2, MOD( ) returns 0 for even numbers, and 1 for odd numbers.
MOD([Grade], 2)
The following example uses MOD( ) and YEAR( ) to get the last digit of a year. YEAR( ) returns the year number of a date. Dividing a number by 10 returns the last digit of the number.
MOD(YEAR([BirthDate]), 10)

 Additional Links: Forums | Blogs | Support | Give Us Feedback | More...