Product Documentation

SQL Reference Guide

Previous Topic

Next Topic

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 ADMIN.SYSCALCTABLE;

Notes

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

TOCIndex