Beginner

215. Current Date

Learn how to retrieve the current date from a database system.

📘 Lesson 215 of 728 ⏱ 8 min 🎯 Beginner

SQL database systems provide functions or expressions for retrieving the current date. The exact syntax depends on the database platform.

Current-date calculations are important for time-sensitive reports, aging analysis, monitoring, and date-based business rules.

Display the current date along with employee information.

SQL
SELECT
    CURRENT_DATE AS Today;

Current dates are useful for calculating employee tenure, account age, due dates, reporting periods, and operational status.

  • Current date returns the database session's current date.
  • Syntax varies between database systems.
  • It is useful for date calculations.
  • It can be used in WHERE conditions.
  • Time-zone behavior depends on the database system.
How can you get the current date in SQL?

Many databases support CURRENT_DATE, although the exact syntax can vary.

Why is the current date useful?

It allows queries to perform calculations and filtering relative to today's date.

Have you finished this lesson?

Introduction to SQL – All Lessons