22-25 April 2026

Good dates, bad dates: Mastering your T-SQL date and time datatypes

Regular 50 minute session for SQLBits 2026

TL; DR

Working with date/time datatypes in T-SQL can be quite frustrating if you don’t have the tools and know-how. This session will cover the wide range of datatypes available in SQL Server/Azure SQL, and help you understand which ones are right for your goals. We’ll dig in to explicit and implicit conversions, optimal indexing strategies, and some hidden gotchas when working with date/time data.

Session Details

Working with date/time datatypes in T-SQL can be quite frustrating if you don’t have the tools and know-how. Let me arm you with all the knowledge you need to correctly model, convert, index and query your date/time data in a logical and easy-to-understand manner.

We’ll cover the wide range of datatypes available in SQL Server/Azure SQL, and help you understand which ones are right for your goals. We’ll dig in to explicit and implicit conversions, optimal indexing strategies, and some hidden gotchas when working with date/time data.

For the icing on the cake, we’ll also look at some horrible real-world anti-patterns from the trenches, and how to address them like a pro.

3 things you'll get out of this session

* Understanding the different date and time datatypes
* Understanding various T-SQL date/time functions
* Being able to index and optimize date/time workloads