A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Functions: Date and Time Functions

month()

The date & time function month() returns the number of the month without leading zeros of the date declared in the parameter "date expression". The return value is an integer datatype. The function month() is available in ASE® starting with version 15.0.

Syntax of the Datatype Conversion Function month()

    month(date expression)
    

The parameter "date expression" of the Date & Time Function month()

date expression
The parameter "date expression" is a placeholder for a date which can be declared 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 a date format. The parameter "date expression" must be set in quotes.

Example for the Datatype Conversion Function month()

    select month(getdate())
go
-----

Returns the number of the current month without leading zeros of the operating system date.

    select month()
go
-----

Returns the number of the current month without leading zeros of the operating system date. The function month() is comparable to the datepart(mm, date expression) function.

See also:

ASE T-SQL - Aggregate Functions,
Date and Time Functions,
dateadd(),
datediff(),
datename(),
datepart(),
date_part,
day(),
getdate(),
style numbers,
year().