Date and Time Manipulation in Microsoft SQL Server
Play Date and Time Manipulation in Microsoft SQL Server
Dealing with date and time data in SQL Server can be quite challenging. You need to consider language and cultural conventions, performance of your queries, tricky logical aspects, and so on. This session explains how to handle date and time data correctly, such that your code will be language-independent; how to get good performance from your queries; how to handle date and time separately prior to SQL Server 2008; how to calculate first and last day of a period (e.g., first day of the month, last day of the month); how to handle leap years; age calculations, and more. This session also introduces the new date and time related datatypes in SQL Server 2008 including: DATE, TIME, DATETIME2, and DATETIMEOFFSET.