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 - SQL Server Tutorial
From the course: Querying Microsoft SQL Server 2019
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
-
-
-
-
-
-
-
(Locked)
Use functions in T-SQL2m 46s
-
(Locked)
String functions3m 24s
-
(Locked)
Text concatenation3m 33s
-
(Locked)
Round with mathematical functions2m 46s
-
(Locked)
Work with date functions4m 53s
-
(Locked)
FORMAT date and times2m 59s
-
(Locked)
Return random records with NEWID2m 2s
-
(Locked)
The IIF logical function3m 9s
-
(Locked)
Solution: Use functions in a query4m 20s
-
(Locked)
-
-
-
-
-