How to get the day (Mon,Tue...) from a given date?

Hi,

How do you get the day from a date ?
ie. today 12th May, 2022 is Wednesday
Something like
SELECT DATENAME(WEEKDAY, GETDATE())
would return “Wednesday”

Thanks!

Hi There,
Good catch, this is not available as a method in RAW SQL but you can use the weekday() library function here:

HTH
-Georges