I want to be able to pass in a day number like 1, 2, 3 or 7 and it will return the day name like Sunday, Monday, Tuesday or Saturday. I know there is the option of using a <
SELECT DATENAME(DW,CAST(a AS INT))
Here we can change the value of a as 0 to 6 Default, 0-Monday to 6- Sunday. If we use a=7 then it will be calculated as 0, because 7-7=0.