Chapter 8 SQL Functions
349
MINUTES (
datetime-expression
|
datetime-expression
,
datetime-expression
|
datetime-expression
,
integer-expression
)
datetime-expression A date and time.
integer-expression The number of minutes to be added to the datetime-
expression. If integer-expression is negative, the appropriate number of
minutes are subtracted from the datetime value. If you supply an integer
expression, the datetime-expression must be explicitly cast as a datetime data
type.
$ For information on casting data types, see "CAST function" on
page 318.
The following statement returns the value 1051040527:
SELECT MINUTES( ’1998-07-13 06:07:12’ )
The following statement returns the value 240, to signify the difference
between the two times:
SELECT MINUTES( ’1999-07-13 06:07:12’,
’1999-07-13 10:07:12’ )
The following statement returns the datetime value 1999-05-12 21:10:07.
SELECT MINUTES( CAST( ’1999-05-12 21:05:07’
AS DATETIME ), 5)
♦ SQL/92 Vendor extension.
♦
Sybase Not supported by Adaptive Server Enterprise.
MOD function [Numeric]
Returns the remainder when one whole number is divided by another.
MOD (
dividend
,
divisor
)
dividend The dividend, or numerator of the division.
divisor The divisor, or denominator of the division.
The following statement returns the value 2.
SELECT MOD( 5, 3 )
Division involving a negative dividend will give a negative or zero result.
The sign of the divisor has no effect.
Syntax
Parameters
Examples
Standards and
compatibility
Function
Syntax
Parameters
Examples
Usage