From the course: Querying Microsoft SQL Server 2019

Unlock this course with a free trial

Join today to access over 25,600 courses taught by industry experts.

FORMAT date and times

FORMAT date and times

- [Speaker] Most databases will store date and time data in a data and time data type. That makes logical sense, right? But it's not uncommon to need to present those dates and times as text in reports or interactive forms. This makes them easier to read and understand for end users of the data. For instance, it's much easier to understand the month when you read the name, August instead of the month number, eight. To convert your dates and times into text you can use a sequel server function called format. Let's take a look by working with the employees' hire dates again. This'll give us some date data that we can work with. I'll come back up here and on line number three we'll start the format function. This function takes two arguments. The first is the data that you want to process, in our case, those values are coming out of the hire date column. The second argument is a format string. There's a number of…

Contents