DAY() Function in SQL Server

Rumman Ansari   Software Engineer   2023-03-25   5507 Share
☰ Table of Contents

Table of Content:


Syntax:


Day()

Returns the 'Day number of the Month' of the given date

Code:


Select DAY(GETDATE()) 

Returns the day number of the month, based on current system datetime.

Code:


Select DAY('01/31/2012') 

Output:

The above code will produce the following result-


31