SMALLDATETIMEFROMPARTS()

Returns a smalldatetime value for the specified date and time.

Signature

SMALLDATETIMEFROMPARTS ( year, month, day, hour, minute )

Parameters

  • year — Integer expression specifying a year.
  • month — Integer expression specifying a month.
  • day — Integer expression specifying a day.
  • hour — Integer expression specifying hours.
  • minute — Integer expression specifying minutes.

Examples

SELECT SMALLDATETIMEFROMPARTS ( 2010, 12, 31, 23, 59 ) AS Result;
2010-12-31 23:59:00

Run against SQL Server 16.0.4265.3 on 2026-09-13. This is the output we got, not the documentation’s.

Available on

  • SQL Server 2017 and later
  • Azure SQL Database
  • Azure SQL Managed Instance
  • Azure Synapse Analytics
  • Analytics Platform System (PDW)
  • Fabric SQL database

Signature and description adapted from the Microsoft SQL documentation, used under the CC BY 4.0. SQL Server and Azure are trademarks of the Microsoft group of companies. This page is not affiliated with Microsoft.