I am trying to join 3 tables. Two of the tables I am taking sums of a column. I want to apply conditions on the sums but am not producing the result I want with the below script. The sums are not summing correctly.

```
SELECT 
account_list.Account_ID,
account_list.Account_Name,
account_list.Short_Name,
account_list.Trader,
account_list.Status,
account_list.Notes,
sum(account_commissions.Commission),
sum(connection_cost.Monthly_Cost)
FROM
account_commissions
Join 
connection_cost
ON 
account_commissions.Account_ID = connection_cost.Account_ID
AND 
connection_cost.Cost_Date > '2013-06-01'
AND 
account_commissions.TDate > '2013-06-01'    
Right Join 
account_list
ON
account_list.Account_ID = connection_cost.Account_ID
WHERE
account_list.status = 'Active'
GROUP BY 
Account_ID;

```

The conditions I want on the sums are:

```
sum account_commissions.Commission where account_commissions.TDate > '2013-06-01 Group BY Account_ID 

```

and

```
sum connection_cost.Monthy_Cost where connection_cost.Date > '2013-06-01' Group BY Account_ID. 

```

I tried to achieve that using the above AND statements but it is not computing correctly. Any help on how to apply these conditions to the sum columns would be appreciated.