To get week day name like Sunday, Monday etc. based on a date, we can use datename
function.
select datename(dw, getdate())
select datename(dw, '2015-05-19')
Above both sql statement would give "Tuesday" result.
It gives the name of the day of the week of the date passed (like Tuesday , if this could would have run on 19-May-2015).
Views: 6592 | Post Order: 66