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

DateSerial

Example

Construct a date using its individual components.

SELECT DateSerial(2017420);

Definition and Usage

The DateSerial() function generates a date using specified parts such as year, month, and day values.

Syntax

DateSerial(yearmonthday)

Parameter Values

Parameter

Description

year

Mandatory. Specifies a year using four digits.

month

Mandatory. Specifies a month, ranging from 1 to 12.

day

Mandatory. Specifies a day, ranging from 1 to 31.

Technical Details

WORKS IN

From Access 2000

More Examples

Example

Construct a complete date using its individual components.

SELECT DateSerial(20171041205);