DAYOFWEEK(date_exp)

Returns the day of the week based on the week field in date_exp as an integer value in the range of 1-7, where 1 represents Sunday.

 

Example:

SELECT DAYOFWEEK({d '2001-09-13'}) returns 5

(Thursday as the fifth day of the week)