GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing docs.voltdb.com — MOD() Using VoltDBMOD()MOD() — Returns the result of a modulo operation. SynopsisMOD( dividend, divisor ) DescriptionThe MOD() function performs a modulo operation. That is, it divides one value, the dividend, by another value, the divisor, and returns the remainder of the division operation as a new integer value. The sign of the result, whether positive or negative, matches the sign of the first argument, the dividend. Both the dividend and the divisor must either both be integer values or both be DECIMAL values and the divisor must not be zero. Use of mixed input datatypes or a divisor of zero will result in a runtime error. When using DECIMAL input values, the result is the integer portion of the remainder. In other words, the decimal result is truncated and returned as an integer using the following formula: MOD(a,b) = a - INT(a/b) * b ExampleThe following example uses the HOUR() and MOD() functions to return the hour of a timestamp in 12 hour format SELECT event,
MOD(HOUR(eventtime)+11, 12)+1,
CASE WHEN HOUR(eventtime)/12 < 1
THEN 'AM'
ELSE 'PM'
END
FROM schedule ORDER BY 3, 2; |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |