bugl
bugl
HomeLearnPatternsSearch
HomeLearnPatternsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

SQL Server DAY() Function

Concept visual

SQL Server DAY() Function

Pointer walk
two pointers
leftright102132436485116
left=0
right=6
1
3

Start at both ends

Example

Return the day of the month for a date:

SELECT DAY('2017/08/25') AS DayOfMonth;

Definition and Usage

The DAY() function returns the day of the month (from 1 to 31) for a specified date.

Syntax

Day(

date )

Parameter Values

Parameter

Description date

Required. The date to return the day of the month from

Technical Details

Return type:

int

Works in:

SQL Server (starting with 2008), Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse

More Examples

Example

Return the day of the month for a date: SELECT DAY('2017/08/13 09:08') AS DayOfMonth;

Previous

❮ SQL Server Functions

Next

Previous

SQL Server DATEPART() Function

Next

SQL Server GETDATE() Function