DATENAME function in SQL Server

Friday, 2 December 2011

DATENAME function in SQL Server


This is inbuilt function of SQL-Server.

Syntax

DATENAME ( datepart ,date )

Argument

Datepart Abbreviations

year- yy, yyyy

quarter- qq, q

month- mm, m

dayofyear- dy, y

day- dd, d

week- wk, ww

weekday- dw

hour- hh

minute- mi, n

second- ss, s

millisecond- ms

Return type
nvarchar

Example:



No comments:

Post a comment