Jaa


MONTH (SSIS)

Returns an integer that represents the month datepart of a date.

Syntax

MONTH(date)

Arguments

  • date
    Is a date in any date format.

Result Types

DT_I4

Remarks

MONTH returns a null result if the argument is null.

A date literal must be explicitly cast to one of the date data types.

Using the MONTH function is briefer but equivalent to using DATEPART("Month", date).

Examples

This example returns the number of the month in a date literal. If the date is in "mm/dd/yyyy" format, this example returns 11.

MONTH((DT_DBTIMESTAMP)"11/23/2002")

This example returns the integer that represents the month in the ModifiedDate column.

MONTH(ModifiedDate)

This example returns the integer that represents the month of the current date.

MONTH(GETDATE())

See Also

Reference

DATEADD (SSIS)
DATEDIFF (SSIS)
DATEPART (SSIS)
DAY (SSIS)
YEAR (SSIS)

Other Resources

Functions (SSIS)

Help and Information

Getting SQL Server 2005 Assistance