Good dates, bad dates: Mastering your T-SQL date and time datatypes
Regular 50 minute session for SQLBits 2026TL; 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.
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
* Understanding various T-SQL date/time functions
* Being able to index and optimize date/time workloads
Speakers
Daniel Hutmacher's other proposed sessions for 2026
20 years of productivity tips - a love letter to SSMS - 2026
Inside SQL Server 2025 Part 1 - 2026
Inside SQL Server 2025 Part 2 - 2026
JSON fundamentals for SQL pros - 2026
SQL Injection – The Old Dog of Data Security - 2026
SQL Noire – A Database Murder Mystery - 2026
T-SQL paging done right - 2026
Daniel Hutmacher's previous sessions
ACID in SQL Server: what it is, how it works, and how to live more adventurously.
A primer on ACID compliance in SQL Server, though mostly on Isolation and Durability, since those are the ones you have some control over. Presented at Data Saturday Gothenburg and Oslo 2023.
From substitutions to public keys - an introduction to cryptography
High-level introduction to cryptography.