/*
sql: get day of week (transact-sql)
To retrieve day of week information using T-SQL you can use the DATENAME and
DATEPART functions. The DATENAME function returns a character string of the
datepart of a date. The DATEPART function returns an integer of the datepart
of a date.
*/
SELECT
DATENAME(dw,GETDATE()) [Day Name] -- returns the day of week name
,DATEPART(dw,GETDATE()) [Day Number] -- returns the day of week number
,DATENAME(dy,GETDATE()) [Day of Year] -- returns the day of year
,DATEPART(wk,GETDATE()) [Week Number] -- returns the week number of the year
, GETDATE() [Todays Date]