DATEDIFF() – Time Related Functions

I am constant in my creation of short articles or tidbits on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Many times you will want to calculate the difference between two given dates using a particular unit of measure (date part) like hours, minutes, or seconds. Today, I will be exploring the DATEDIFF() function. This function has 12 different input parameters that can be passed to change the resulting output. To summarize, the function takes a date part, a…

DATEADD() – Time Related Functions

I am a eager beaver in my creation of short articles or tidbits on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Many times you will want to add or subtract a fixed number of years, months, or etc from a date time variable. Today, I will be exploring the DATEADD() function. This function has 13 different input parameters that can be passed to change the resulting output. To summarize, the function takes a date part, a offset number,…

DATENAME() – Time Related Functions

I am unrelenting in my creation of short articles or tidbits on Transaction SQL date/time functions. Most, if not all, modern day computer systems collect data which contains dates and times. Many times you will want to convert the data from one data type to another. Today, I will be exploring the DATENAME() function. This function has 15 different input parameters that can be passed to change the resulting output. In short, the function takes a date part and date/time variables as input returns the part that you want a…