Hi smile,
Its not possible to get the DayName of your provided input Data.
You are saving the date in invalid form. First you need to Save the Date in valid format.
Once you save the date in valid format like yyyy.mm.dd then convert the varchar value to Date and form that date you can get the DayName.
Refer the below example.
SQL
DECLARE @Test AS TABLE(ExamDate VARCHAR(50))
INSERT INTO @Test VALUES('2018.01.28'),('2018.01.29'),('2018.01.30')
SELECT ExamDate,DATENAME(WEEKDAY,CONVERT(DATE, ExamDate, 102)) 'Day' FROM @Test
Output
ExamDate |
Day |
2018.01.28 |
Sunday |
2018.01.29 |
Monday |
2018.01.30 |
Tuesday |