Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind SQL Server DATEFROMPARTS() Function?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___ DATEFROMPARTS(2018, 10, 31) AS DateFromParts;3Order
Put the learning moves in the order that makes the concept easiest to apply.
The DATEFROMPARTS() function returns a date from the specified parts (year, month, and day values).
Definition and Usage
SQL Server DATEFROMPARTS() Function
Example
SELECT DATEFROMPARTS(2018, 10, 31) AS DateFromParts;Definition and Usage
The DATEFROMPARTS() function returns a date from the specified parts (year, month, and day values).
Syntax
DATEFROMPARTS(
year
,
month
,
day
)Parameter Values
| 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) |
Technical Details
| Return type: | date |
|---|---|
| Works in: | SQL Server (starting with 2012), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse |