
sql
Week of the Month in Mysql
SELECT WEEK(my_date_field,5) - WEEK(DATE_SUB(my_date_field, INTERVAL DAYOFMONTH(my_date_field)-1 DAY),5)+1 Recently I needed to get the number of the week in a certain month. There is the handy WEEK() function, however it only gives you the week of