Error message

Recursion detected in view course_view display block_7.

SQL Server - Working with Dates Part 1

Ian & I have received a lot of queries from past delegates about handling various date challenges when extracting data from SQL Server and Oracle databases, so we are adding them to our blog for your reference. There will be a series of posts and this is Part 1.

The following examples are for SQL Server, and are based on the AdventureWorks2014 sample database.

The following queries uses the DATENAME and DATEADD functions.

DATENAME Function

DATENAME can be used to extract a specified part of a date/time value. It takes two arguments: