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

DateValue

Example

Generate a date based on the provided string representation.

SELECT DateValue(“May 17, 2017”);

Definition and Usage

The DateValue() function converts a string into a date value.

Note: If the string lacks a year component, the function defaults to the current year.

Syntax

DateValue(string_date)

Parameter Values

Parameter

Description

string_date

Mandatory. A string that denotes a date, valid within the range from January 1, 100 to December 31, 9999.

Technical Details

WORKS IN

From Access 2000

More Examples

Example

Generate a date based on the provided string, assuming it does not include a year component.

SELECT DateValue(“May 17”);