Return a date from its parts:
SELECT DATEFROMPARTS(2018, 10, 31) AS DateFromParts;
Try it Yourself »
The DATEFROMPARTS() function returns a date from the specified parts (year, month, and day values).
DATEFROMPARTS(
year,
month,
day)
Parameter | Description |
---|---|
year | Required. Specifies a year (4 digits) |
month | Required. Specifies a month (from 1 to 12) |
day | Required. Specifies a day (from 1 to 31) |
Works in: | SQL Server (starting with 2012), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |
---|
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!