How can I get the end date of a quarter with SQL?

It will depend on the database you’re using!

As you can see below, there can be quite some variations in syntax between Vertica, SQL Server, MySQL, PostgreSQL

 

So, what’s common in all these examples? In all cases, you will need:

  • a function that gets the current date
  • a function that extracts the year from the current date
  • a function that concatenates strings
  • a function that converts a string to a date

Need help with those?

Check out my other blog posts:

Happy SQL-ing!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.