How do I convert string to a date with SQL?

Hit a couple of error messages when trying to convert a string to a date?

And that’s totally not surprising!

As you’ll see below the text-to-date conversion functions within the different database environments seldom have identical syntax

Why would you want to convert a string to a date?

Well, it could be pretty useful if you want to:

  • return the end date of a given quarter
  • calculate the remaining days until the end of the current calendar quarter
  • calculate the remaining days until the end of the current fiscal quarter

Wanna know how to do these?