DATEPART (Transact-SQL) [!INCLUDE sql-asdb-asdbmi-asa-pdw] This function returns an integer representing the specified datepart of the specified date. See Date and Time Data Types and Functions ...
此函数在 [SQL Server](https://www.geeksforgeeks.org/sql-server-identity/) 中用于查找指定日期的给定部分。此外,它以整数形式返回输出值。
Isn't there an easy way to get a 2-digit day from a SQL query?<BR><BR>SELECT datepart(dd, getDate()); <BR><BR>will return "1" for July 1st. How can I get it to return ...