Returns the number of minutes since an arbitrary date and time, the number of whole minutes between two specified times, or adds the specified integer-expression number of minutes to a time.
MINUTES ( datetime-expression
| datetime-expression, datetime-expression
| datetime-expression, integer-expression )
Parameter |
Description |
---|---|
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 date/time. If you supply an integer expression, the datetime-expression must be explicitly cast as a datetime data type |
INT
TIMESTAMP
Returns the value 1051125487:
SELECT MINUTES( '1998-07-13 06:07:12' ) FROM iq_dummy
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' ) FROM iq_dummy
Returns the datetime value 1999-05-12 21:10:07.000:
SELECT MINUTES( CAST( '1999-05-12 21:05:07' AS DATETIME ), 5) FROM iq_dummy