Skip to content

Latest commit

 

History

History
72 lines (51 loc) · 2.24 KB

day-ssis-expression.md

File metadata and controls

72 lines (51 loc) · 2.24 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
DAY (SSIS Expression)
DAY (SSIS Expression)
chugugrace
chugu
03/01/2017
sql
integration-services
conceptual
DAY function
dates [Integration Services], DAY

DAY (SSIS Expression)

[!INCLUDEsqlserver-ssis]

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

Syntax

  
DAY(date)  

Arguments

date
Is an expression that returns a valid date or a string in date format.

Result Types

DT_I4

Remarks

DAY returns a null result if the argument is null.

A date literal must be explicitly cast to one of the date data types. For more information, see Integration Services Data Types.

Note

The expression fails to validate when a date literal is explicitly cast to one of these date data types: DT_DBTIMESTAMPOFFSET and DT_DBTIMESTAMP2.

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

Expression Examples

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

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

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

DAY(ModifiedDate)  

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

DAY(GETDATE())  

See Also

DATEADD (SSIS Expression)
DATEDIFF (SSIS Expression)
DATEPART (SSIS Expression)
MONTH (SSIS Expression)
YEAR (SSIS Expression)
Functions (SSIS Expression)