Introduction to SQL Server’s Date Functions
SQL server’s date functions provide you a set of function that you can use to manipulate dates. The function are used for a wide variety of operation such as adding weeks to a date, calculating the difference between two dates, or to decompose a date into its fundamental parts.
If you not familiar with SQL functions, then I would recommend staring with the Introduction to SQL Server Built-In Functions.
To get the most of this and our other lessons be sure to practice using the examples!
There are over twenty five different functions categorized as date functions in SQL server.
All of the functions are listed on the Date Functions (Transact-SQL) page. I would recommend visiting that page to learn about each function.
Rather than reiterate that material, we’ll focus on the functions I’ve seen in commonly used in business.
In the following tables I categorized the functions and color coded them. The color code corresponds to the likely hood you would use that particular function in a business environment. Green are most likely to be used, and red less.
This isn’t a strict scale, and all functions have a use in some business case, but I wanted a way to help you winnow down the field to those most relevant.
Here is my attempt: