T-SQL 101: 60 Finding names of date and time components in SQL Server T-SQL
In an earlier post, I showed how you could extract the year, month, day, etc. from dates. But these came back as numbers. So instead of “March”, I got 3 returned.
Sometimes though, I want the name of the period, not the number.
Look at this query:
And you can see what it returns here:
This looks easy, but what if I’m not speaking English? It’s important to understand that functions like DATENAME are affected by the regional/language settings that you are currently using in your session.
2020-03-09