Mod
Returns the remainder after a number is divided by a divisor.
Format
Mod ( number ; divisor )
Parameters
number
- any numeric expression or field containing a numeric expression
divisor
- numeric expression or field containing a numeric expression
Data type returned
number
Originated in version
6.0 or earlier
Description
Use the Mod function when converting units of measure, such as from minutes to hours, to return the number of remaining units.
Example 1
Calculates 210 divided by 4, with a remainder of 2.
Mod ( 210 ; 4 )
returns 2.
Example 2
Converts the hours portion of a time from 24-hour notation to 12-hour notation. When the 24hTime field contains 16:
Mod ( 24hTime ; 12 )
returns 4.
Example 3
Converts a number of months into a number of years and remaining months. When the NumberOfMonths field contains 31:
Int ( NumberOfMonths / 12 ) & " years, " & Mod ( NumberOfMonths ; 12 ) & " months"
returns 2 years, 7 months.