Technical requirements
To work with the examples and illustrations in this chapter, you will need Azure Data Studio or SQL Server Management Studio installed. We will be working with the WideWorldImportersDW
database on SQL Server or Azure SQL Database. Please refer to the Appendix for tool installation and database restoration guidance.
You will find the code from this chapter here on GitHub: https://github.com/PacktPublishing/SQL-Query-Design-Best-Practices/tree/main/Chapter03
Using the FORMAT() function
FORMAT()
is an extremely versatile function for changing how certain strings, dates, and numeric values look. We will consider a few popular things we can do with FORMAT()
in this section.
For the examples in this section, we will mainly leverage the dimension date table and the fact sales table from the WideWorldImportersDW
database discussed in previous chapters to showcase date and number formatting possibilities. Let’s check out some of the possibilities in...