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

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())

 

  • Meet Author

    S.Abhilash, started this blog in the later half of 2009 as a self hosting site for all his previous blogging attempts. , My way of writing and frequency of publishing may not be uniform as my resources are my projects nd issues i came across. For the last few years this blog is reacing 100 s of unique visitors each day, thanks wordpress and google for such a perfection in their software and services.

    Head to Authors Page | Abhilash on Facebook



Category MSSQL Server     Tags , , , , , , , , , , , , , , , , , , , , , , , , , ,

Comment on Facebook

Comments are closed.

Community



FREE News Letter

Enter your email address

See Also

Resources

Please Submit your Email Address to Get Latest Technology News As it Happens


Enter your email address


Read previous post:
Classic ASP on IIS 7 doesnt Return Error Messages to Browser

Classic ASP Scripts are fully supported in IIS7 and unfortunately they made some changes in Debug mode This may trouble...

Close