DAY() Function in SQL Server Last Updated : 18 Jan, 2021 Comments Improve Suggest changes Like Article Like Report DAY() function : This function in SQL Server is used to return the day of the month i.e, from 1st to 31st for date stated. Features : This function is used to find the day of the month for a date specified. This function comes under Date Functions. This function accepts only one parameter i.e, date. This function can also include time with the stated date. Syntax : DAY(date) Parameter : This method accepts only one parameter as given below as follows. date -Specified date from which the day of the month is to be returned. Returns : It returns the day of the month i.e, from 1st to 31st for a date specified. Example-1 : Using DAY() function and getting the day of the month from the date specified. SELECT DAY('2020/01/02'); Output : 2 Example-2 : Using DAY() function with a variable and getting the day of the month from the date specified. DECLARE @date VARCHAR(50); SET @date = '2020/01/05'; SELECT DAY(@date); Output : 5 Example-3 : Using DAY() function with date as parameter which includes time as well. SELECT DAY('2018/11/22 07:44'); Output : 22 Example-4 : Using DAY() function with a variable and a date as parameter which includes time as well. DECLARE @date VARCHAR(50); SET @date = '2020/11/30 23:59'; SELECT DAY(@date); Output : 30 Application : This function is used to find the day of the month from the date specified. Comment More infoAdvertise with us Next Article DAY() Function in SQL Server N nidhi1352singh Follow Improve Article Tags : SQL DBMS-SQL SQL-Server Similar Reads DATEADD() Function in SQL Server DATEADD() function : This function in SQL Server is used to sum up a time or a date interval to a specified date, then returns the modified date. Features : This function is used to sum up a time or a date interval to a date specified. This function comes under Date Functions. This function accepts 3 min read DATENAME() Function in SQL Server DATENAME() function : This function in SQL Server is used to find a given part of the specified date. Moreover, it returns the output value as a string. Features : This function is used to find a given part of the specified date.This function comes under Date Functions.This function accepts two para 2 min read DATEPART() Function in SQL Server DATEPART() function :This function in SQL Server is used to find a given part of the specified date. Moreover, it returns the output value as an integer.Features : This function is used to find a given part of the specified date.This function comes under Date Functions.This function accepts two para 2 min read LOG() Function in SQL Server The LOG() function returns the logarithm of a specified number or the logarithm of the number to the specified base. Syntax : LOG(number, base) Parameter : LOG() function accepts two-parameters as mentioned above and described below. number - This parameter hold a number which is greater than 0. bas 1 min read COUNT() Function in SQL Server The COUNT() function in SQL Server is a fundamental aggregate function used to determine the number of rows that match a specific condition. Counting rows provides valuable insights into data sets such as the total number of records, distinct values, or records meeting certain criteria.In this artic 3 min read Like