current_date

Description

Returns the current date.

Syntax

current_date()

Parameters

None.

Examples

Example 1

Identifies the current date with datename:

1>  select datename(month, current_date())
2> go
------------------------------ 
August 

Example 2

Identifies the current date with datepart:

1> select datepart(month, current_date())
2> go
----------- 
8 

(1 row affected)

Usage

Used to find the current date as it exists on the server.

Standards

ANSI SQL – Entry level Compliance.

Permissions

Any user can execute current_date.

See also

Datatypes Date and time datatypes

Commands select, where clause

Functions dateadd, datename, datepart, getdate