Skip to content

Latest commit

 

History

History
75 lines (56 loc) · 2.25 KB

File metadata and controls

75 lines (56 loc) · 2.25 KB
title SMALLDATETIMEFROMPARTS (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/04/2017
ms.prod sql
ms.prod_service database-engine, sql-database, sql-data-warehouse, pdw
ms.reviewer
ms.technology t-sql
ms.topic language-reference
f1_keywords
SMALLDATETIMEFROMPARTS
SMALLDATETIMEFROMPARTS_TSQL
dev_langs
TSQL
helpviewer_keywords
SMALLDATETIMEFROMPARTS function
ms.assetid 7467fdab-e588-419c-9e29-42caec34a9ea
author MikeRayMSFT
ms.author mikeray
monikerRange >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current

SMALLDATETIMEFROMPARTS (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2012-all-md]

Returns a smalldatetime value for the specified date and time.

Topic link icon Transact-SQL Syntax Conventions

Syntax

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

Arguments

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.

Return Types

smalldatetime

Remarks

This function acts like a constructor for a fully initialized smalldatetime value. If the arguments are not valid, then an error is thrown. If required arguments are null, then null is returned.

This function is capable of being remoted to [!INCLUDEssCurrent] servers and above. It is not remoted to servers that have a version below [!INCLUDEssCurrent].

Examples

SELECT SMALLDATETIMEFROMPARTS ( 2010, 12, 31, 23, 59 ) AS Result  

[!INCLUDEssResult]

Result  
---------------------------  
2010-12-31 23:59:00  
  
(1 row(s) affected)