DATENAME returns the part of the date in a literal form. : DATENAME « Date Timezone « SQL Server / T-SQL






DATENAME returns the part of the date in a literal form.

 

17>
18> SELECT DATENAME(mm,GETDATE())
19> GO

------------------------------
October

(1 rows affected)

Year - yy, yyyy
Month - mm, m
Week - wk, ww
Day - dd, d
Hour - hh
Minute - mi, n
quarter - qq
day of year - dy
seconds - ss
milliseconds - ms

 








Related examples in the same category

1.Using the DATENAME() Function
2.Find out the month name in two months time
3.DATENAME: return the part of the date in a literal form
4.DATENAME(month, '4-29-1988') returns a string containing the descriptive name
5.select DATENAME(day, '2002-09-30 11:35:00')
6.select DATENAME(year, '2002-09-30 11:35:00')
7.select DATENAME(hour, '2002-09-30 11:35:00')
8.select DATENAME(minute, '2002-09-30 11:35:00')
9.select DATENAME(second, '2002-09-30 11:35:00')
10.select DATENAME(quarter, '2002-09-30 11:35:00')
11.select DATENAME(dayofyear, '2002-09-30 11:35:00')
12.select DATENAME(week, '2002-09-30 11:35:00')
13.select DATENAME(weekday, '2002-09-30 11:35:00')