How to: |
The MOD functions calculate the remainder from a division. Each function returns the remainder in a different format.
The functions use the following formula.
remainder = dividend - INT(dividend/divisor) * divisor
For information on the INT function, see INT: Finding the Greatest Integer.
function(dividend, divisor, output)
where:
Is one of the following:
DMOD returns the remainder as a decimal number.
FMOD returns the remainder as a floating-point number.
IMOD returns the remainder as an integer.
Numeric
Is the number being divided.
Numeric
Is the number dividing the dividend.
Numeric
Is the result whose format is determined by the function used.
IMOD divides ACCTNUMBER by 1000 and stores the remainder in a column with the format I3L.
IMOD(ACCTNUMBER, 1000, 'I3L')
For 122850108, the result is 108.
For 163800144, the result is 144.
iWay Software |