Count number of Saturdays between two dates - MySql

date, mysql

Solution

SELECT received_on,closed_on, FLOOR(DATEDIFF(DATE(received_on), DATE(closed_on))/7) as numofsat FROM table

Problem

I am attempting to view two columns from my table, *received_on* and *closed_on*. I also wanted a third column that counted how many saturdays existed between the two dates in each row. So far, I was thinking something like ``` where year(date)=2011 and weekday(date)=5 ``` So my question again is how can I count how many Saturdays exist between two dates in each row? EDIT Row 1: ``` received_on 2013-11-29 closed_on 2013-12-02 ``` of Saturday's: 1 Row 2: ``` received_on 2013-12-4 closed_on 2013-12-09 ``` of Saturday's: 1

Original source