Getting Today’s Date in SQL

Each type of database has it’s own way to extract today’s date using SQL. Here’s a quick cheat-sheet of the SQL functions used to get today’s date from the most popular relational databases.

SELECT <insert date function> FROM <table>

  • SQL Server, Azure SQL DB – GETDATE()
  • Amazon Redshift, MariaDB, MySQL, Oracle, Postgres, SQLite – CURRENT_DATE
  • MariaDB, Oracle – SYSDATE
  • MariaDB, MySQL – CURDATE()
  • DB2 – CURRENT DATE