MOD: Returning the Remainder of a Division

How to:

The SQL function MOD returns the remainder of the first argument divided by the second argument.

Syntax: How to Return the Remainder of a Division

MOD(n,m)

where:

n

Numeric

Is the dividend (number to be divided).

m

Numeric

Is the divisor (number to divide by). If the divisor is zero (0), MOD returns NULL.

Example: Returning the Remainder of a Division

MOD returns the remainder of n divided by m.

MOD(N,M)

For N=16 and M=5, the result is 1.

For N=34.5 and M=3, the result is 1.5.

WebFOCUS

Feedback