I have two tables with each of table having their same ID from the first time of Member Join.

Once the member has been Approved, he/she will be Rejected also for a some reason and condition.

The Query Result needs to sort by date ranges then counting total approves and total rejects based on each date from chosen ID.

**In this case, I've selected for join\_id 325.**

Table approves:

```
join_id         approved_date
325             2016-03-20
326             2016-03-20
326             2016-03-20
325             2016-03-21
326             2016-03-21
325             2016-03-21
325             2016-03-21
327             2016-03-21
325             2016-03-22
327             2016-03-22
325             2016-03-22

```

Table rejects:

```
join_id         rejected_date
325             2016-03-20
325             2016-03-20
326             2016-03-20
325             2016-03-21
327             2016-03-21
325             2016-03-22
327             2016-03-22
325             2016-03-22

```

This is I've tried:

```
SELECT
approved_date,
COUNT(join_id) AS join_id
FROM approves
WHERE join_id = 325
AND approved_date BETWEEN '2016-03-19' AND '2016-03-26' + INTERVAL 1 DAY
GROUP BY DATE_FORMAT(approved_date, '%Y-%m-%d');

SELECT
rejected_date,
COUNT(join_id) AS join_id
FROM rejects
WHERE join_id = 325
AND rejected_date BETWEEN '2016-03-19' AND '2016-03-26' + INTERVAL 1 DAY
GROUP BY DATE_FORMAT(rejected_date, '%Y-%m-%d');

```

Results for join\_id **325** I expected:

```
date_time|approves|rejected
2016-03-19|0|0
2016-03-20|1|2
2016-03-21|3|1
2016-03-22|2|2
2016-03-23|0|0
2016-03-24|0|0
2016-03-25|0|0
2016-03-26|0|0

```