Summary
In this chapter, we walked through various examples of how we can format dates and numbers using a few different functions, such as FORMAT()
, CONVERT()
, and CAST()
. They should help us to deliver what the business requires from a reporting perspective on data formats. With all these functions, we should be able to handle all of the requirements stakeholders send our way. Just remember to always start from available default formats for the initial walkthrough of the report, and then go into the specifics with the end users to get more detailed requirements and adjust as needed. This not only simplifies the initial build of the report but also allows us to continue with any other queries we may be running without having to worry about data types (remember the FORMAT
function turns all inputted data into varchar
). It will also save both the developer and business user valuable time.
In the next chapter, we will look at manipulating the results using conditional SQL, further...