|
year()
The
date & time function
year()
returns the number of the year date specified in the parameter "date_expression".
The return value is of the
datatype
integer.
The function year() is available in
ASE®
starting with version 15.0.
Syntax of the Date & Time Function year()
The parameter "date expression" of the Date & Time Function year()
date expression
The parameter "date expression" is a placeholder for a date, which can be specified
in the format of a
datetime,
smalldatetime,
date (starting with
ASE®
version 15.0),
time (starting with ASE® version 15.0)
datatype
or as
character string
in date format. The parameter "date expression"
must be set in quotes.
Example for the Date & Time Function year()
select year(getdate())
go
-----
Returns the current year based on the operating system time.
Returns the current year based on the operating system time. The
Function
year() can be compared to the
datepart(yy, date expression)
function.
See also:
ASE T-SQL - Aggregate Functions, Date and Time Functions, dateadd(), datediff(), datename(), datepart(), date_part, day(), getdate(), month(), style numbers.
|