In this article Syntax Arguments Return Type Return Value Show 10 more Returns an integer that represents the specified datepart of the specified date. For an overview of all Transact-SQL date and time data types and functions, seeDate and Time Functions (Transact-SQL). For information and exam...
如果指定了无效的日期表达式值(例如,字母文本字符串),DATEPART将生成SQLCODE -400错误代码和以下 %msg: Invalid input to DATEPART() function: DATEPART('year','badval')。如果指定的日期表达式未通过验证(如下所述),datepart将生成一...
Transact-SQL reference for the DATEPART function. This function returns an integer corresponding to the datepart of a specified date.
In this article Syntax Arguments Return Type Return Value Show 10 more Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) This function returns an integer representing the specifieddatepartof the specifieddate. ...
SQL Server Azure SQL 数据库 Azure SQL 托管实例 Azure Synapse Analytics Analytics Platform System (PDW) 此函数返回表示指定 date 的指定 datepart 的整数 。 有关所有 Transact-SQL 日期和时间数据类型及函数的概述,请参阅日期和时间数据类型及函数 (Transact-SQL)。
This function returns an integer representing the specifieddatepartof the specifieddate. SeeDate and Time Data Types and Functions (Transact-SQL)for an overview of all Transact-SQL date and time data types and functions. Transact-SQL syntax conventions ...
如果指定了无效的日期表达式值(例如,字母文本字符串),DATEPART将生成SQLCODE -400错误代码和以下%msg: Invalid input to DATEPART() function: DATEPART('year','badval')。如果指定的日期表达式未通过验证(如下所述),datepart将生成一个SQLCODE -400错误代码,并显示以下%msg: Unexpected error occurred: <ILLEGAL VA...
In this article Syntax Arguments Return Type Return Value Show 10 more Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) This function returns an integer representing the specifieddatepartof the specifieddate. ...
In SQL Server, the DATEPART() function returns an integer representing the specific part of the given date e.g. day, month, year, hour, seconds, etc. The DATEPART() and DATENAME() are similar except for the return type. DATEPART returns int and DATENAME returns nvarchar. DATEPART (datepar...
SQL Server Azure SQL 数据库 Azure SQL 托管实例 Azure Synapse Analytics Analytics Platform System (PDW) 此函数返回表示指定 date 的指定 datepart 的整数 。 有关所有 Transact-SQL 日期和时间数据类型及函数的概述,请参阅日期和时间数据类型及函数 (Transact-SQL)。