It would be better, if we know the different functions available with SQL Server for date and time. So that we can make use of functions properly in different scenarios. In this article we will go through all the available date and time data types and functions with sample codes. This article will list down the available date and time data types and functions for SQL Server version from 2000 and above. If you want more info on any items then click on the 'read more details' of that section and that link will take you to MSDN site.
Table Of Contents
- Date and Time Data Types - Quick Reference
- Date and Time Data Types - In Detail
- Date and Time Functions - Quick Reference.
- Date and Time Functions - In Detail
- SET DATEFIRST
- SET DATEFORMAT
- Functions that can affect the output of date functions
- Functions that helps to convert date and time values to and from string literals and other date and time formats.
- Interesting Date and Time Questions
The main objective of this article is to give a common place for all date and time data types and functions for all SQL Server versions so that we don't need to jump from one page to another. This article will help you to understand the different functions available with different versions of SQL Server with simple examples (All examples are self descriptive). At the same time this article can be used as a quick reference too.
We're talking 21 pages of Date Time Data Type text... yeah, wow. I love the comparison across versions matrixes.