Dates and Times in SQL Server: DATEADD()

We are now in the home stretch of the long-running series about dates and times in SQL Server and Azure SQL Database. This week we look at one of my favourite T-SQL functions when it comes to dates and times: DATEADD(). Syntax As with similar functions, DATEADD can do arithmetic on dates as well as
-> Continue reading Dates and Times in SQL Server: DATEADD()

Dates and Times in SQL Server: DATENAME()

Last time we looked at DATEPART(). This post is all about the DATENAME() function. So many similarities There are many similarities between DATEPART and DATENAME. Where DATEPART returns the date or time part as an integer, DATENAME returns the part as a character string. This DATENAME function also takes two parameters: the date or time
-> Continue reading Dates and Times in SQL Server: DATENAME()

calendar

Dates and Times in SQL Server: DATEPART()

In my previous posts in this series we’ve seen reference to Transact-SQL (T-SQL) functions that are used to get the specific part of a date and/or time (year, month, day, hour, minute, second, etc.). This week we’ll go through one of them and see how it works. Introducing DATEPART, a built-in function that takes two
-> Continue reading Dates and Times in SQL Server: DATEPART()