DAYOFWEEK() returns a numeric representation of the day of the week for a given date, where 1 represents Sunday, 2 represents Monday, and so on through 7 for Saturday. This function is useful for date-based calculations, filtering, and reporting where you need to work with numeric day values.
DAYOFWEEK(date)DAYOFWEEK() returns an integer from 1 to 7, or 0 for NULL dates
DAYOFWEEK(DATE("12/25/2025"))           = 5  (Thursday)
DAYOFWEEK(DATE(2025, 12, 25))          = 5  (Thursday)
DAYOFWEEK(DATE("2025-01-01"))          = 4  (Wednesday)
DAYOFWEEK(DATE("2025-02-28"))          = 6  (Friday)
DAYOFWEEK(DATE("2025-03-31"))          = 2  (Monday)
DAYOFWEEK(CURDATE())                   = 4  (Wednesday, if run on March 19, 2025)
DAYOFWEEK(NULL)                        = 0