How to find date name in MSSQL

How to find Date Name in MSSQL:

if you want to return a weekday or date name of particular date then it is so simple in MSSQL.

See the example:

select DATENAME(dw , getDate())

This query returns today’s date name like Sunday, Monday etc.

You can pass “dw” or “weekday” as a first parameter to date name which specifies the part of date returned.

2 Responses

  1. [...] Snippet(s): Select Records Less Than 24 Hours Old | How to find date name in MSSQL [...]

  2. Simply you can pass your date in this query


    select DATENAME(dw , '2009-01-01')

    ------------
    Thursday

Leave a Reply