MOD Function
The MOD function takes as arguments two real number
operands, and returns the remainder from integer division of the integer
part of the first argument (the dividend) by the integer part
of the second argument (the divisor). The value returned is
an INT data type (or INT8 for remainders outside the range of INT).
The quotient and any fractional part of the remainder are discarded.
The divisor cannot be 0. Thus, MOD (x,y)
returns y
(modulo x)
. Make sure that any variable that receives the
result is of a data type that can store the returned value.
SELECT MOD(TODAY - MDY(1,1,YEAR(TODAY)),30) FROM orders;