Menu

SQL Server ODBC MINUTE() Scalar Function

Updated on

SQL Server does not provide a bare native T-SQL MINUTE() function. It supports MINUTE as an ODBC scalar function inside an ODBC escape sequence: {fn MINUTE(time_exp)}. Microsoft documents this function as returning an integer from 0 to 59. See ODBC scalar functions in Transact-SQL.

ODBC syntax

SELECT {fn MINUTE(time_exp)};

For example, SQL Server can interpret the ODBC escape form in a Transact-SQL statement:

DECLARE @value datetime2 = '2026-09-28T15:30:45';

SELECT {fn MINUTE(@value)} AS minute_value;

The result is 30.

Native T-SQL alternative

For ordinary T-SQL, extract the minute with DATEPART:

DECLARE @value datetime2 = '2026-09-28T15:30:45';

SELECT DATEPART(minute, @value) AS minute_value;

See the SQL Server DATEPART() reference for supported date parts and examples.