APPX Software Library

Chapter 4: SQL Language Elements

4.9.2.50 MOD function (ODBC compatible)

Syntax

MOD ( expression1, expression2 )

Description

The scalar function MOD returns the remainder of expression1 divided by expression2.

Example

SELECT MOD (11, 4) 'Modulus'
     FROM SYSTPE.SYSCALCTABLE;

Notes

  • Both expression1 and expression2 must evaluate to exact numeric data types.
  • If expression2 evaluates to zero, MOD returns zero.