Only Year
DATE_FORMAT({t}.{f}, '%Y')→ Returns a 4-digit year (e.g.,2026).DATE_FORMAT({t}.{f}, '%y')→ Returns a 2-digit year (e.g.,26).YEAR({t}.{f})→ A direct alternative function to extract the year as a numeric value.
Year-Month Variations
DATE_FORMAT({t}.{f}, '%Y-%m')→ Standard numeric year-month (e.g.,2026-08).DATE_FORMAT({t}.{f}, '%Y/%m')→ Slash-separated year-month (e.g.,2026/08).DATE_FORMAT({t}.{f}, '%M %Y')→ Full month name and year (e.g.,August 2026).DATE_FORMAT({t}.{f}, '%b-%y')→ Short month text and 2-digit year (e.g.,Aug-26)
Week Variations
DATE_FORMAT({t}.{f}, '%Y-%u')→ Year and week number, where Monday is the first day of the week (e.g.,2026-31).DATE_FORMAT({t}.{f}, '%Y-%v')→ Year and week number (ISO 8601 standard, where week starts on Monday and week 1 is the first week with 4+ days).DATE_FORMAT({t}.{f}, '%Y-%U')→ Year and week number, where Sunday is the first day of the week.WEEK({t}.{f})→ A direct alternative function to extract just the numeric week number of the year.