Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

DATEFROMPARTS

Example

Construct a complete date using its individual components.

SELECT DATEFROMPARTS(20181031AS DateFromParts;

Definition and Usage

DATEFROMPARTS() function constructs a date using provided year, month, and day values.

Syntax

DATEFROMPARTS(yearmonthday)

Parameter Values

Parameter

Description

year

Required: Specifies a year using four digits.

month

Required: Specifies a month ranging from 1 to 12.

day

Required: Specifies a day ranging from 1 to 31.

Technical Details

Return type:

date

Works in:

SQL Server (beginning from 2008), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse