The YEAR function returns the year component from a date value.
Year extraction is important for annual reporting, year-over-year comparisons, financial analysis, and long-term trend analysis.
Extract the year from customer registration dates.
SELECT
CustomerID,
YEAR(RegistrationDate) AS RegistrationYear
FROM Customers;
YEAR is commonly used in annual sales reports, financial statements, employee analysis, and year-over-year business comparisons.
- YEAR extracts the year component.
- It is useful for annual analysis.
- It can be used in filtering.
- It can be used with GROUP BY.
- Syntax varies between database platforms.
What does YEAR do?
YEAR returns the year component from a date.
How is YEAR used in business reporting?
YEAR allows records to be grouped and compared across different years.