MSSQL Server Date Manipulations (datename)

In MSSQL Server its necessary for to see weekname (sunday,monday,etc..) and, weekcount and even some times its important to the day count in an year and most of DBA s directly count these , but SQL has a lot of built in Functions

In MSSQL Server its necessary for to see weekname (sunday,monday,etc..) and, weekcount and even some times its important to the day count in an year and most of DBA s directly count these , but SQL has a lot of built in Functions

have a look at the datename function and its parameters

dateepart Abbreviations

Year yy, yyyy
quarter qq, q
Month mm, m
dayofyear dy, y
Day dd, d
Week ww,dw
Hour hh
minute mi, n
second ss, s
millisecond ms

USAGE for Week day name

select datename (dw,getdate())

 

abhilash

abhilash, is a programmer by profession and a technology addict with a passion towards browsing , shopping and imaging . My views may be biased on reviews. all images and videos are copyrighted to respective owners.

Add comment

Your Header Sidebar area is currently empty. Hurry up and add some widgets.