Adding two dates in SQL Server does not raise an error. It returns a date in the year 2126. This puzzle explains how datetime counts days from 1900, why the plus sign accepts a second date, and what to write instead.
SQL SERVER – Simple Explanation of AT TIME ZONE Feature
The AT TIME ZONE feature arrived in SQL Server 2016. Here is a simple two-step example that converts US East Coast time to West Coast time.
SQL SERVER – Convert Decimal to Time Format in String
A very strange question I received the other day in an email about how to convert decimal to time format string.
What is the Biggest Limitation of ISDATE() Function? – Interview Question of the Week #137
Why does ISDATE(‘6666-04-30’) return 1 but ISDATE(‘1111-04-30’) return 0? Here are what I see as the two biggest limitations of the ISDATE() function.
SQL SERVER – Learning DATEDIFF_BIG Function in SQL Server 2016
DATEDIFF returns INT and overflows with Msg 535 on large ranges. SQL Server 2016 adds DATEDIFF_BIG, which returns BIGINT. Here is a simple example.
How to Count Week Days Between Two Dates? – Interview Question of the Week #132
How do you count Week Days between two dates in SQL Server? Here is a short script I built from scratch using spt_values and DATEPART.
FORMAT Function in SQL Server: Dates, Numbers and Speed
The FORMAT function turns a date or a number into text with one pattern, and it needs SQL Server 2012 or later. This post shows the patterns for dates and numbers, the culture argument, and the lower case mm that silently returns minutes instead of the month. It also measures FORMAT against CONVERT over 200,000 rows, so you know when to use which.




