Hi
I do not get it. I have the below SQL statement. I would expect that commission est
etc (all fields with values) would be grouped and totaled. i.e.if commission had three lines with £10 on each a group result of £30 would show. But it does not it shows £10. Whats wrong with my code. (hay.. maybe I am just tired)
SELECT
users.id,
users.first_name,
users.second_name,
accounts.commission_est AS commission est (paid)
,
accounts.commision_actual AS commission actual (paid)
,
accounts.diff_commission,
accounts.commission_est_cal AS commission est (earned)
,
accounts.commission_actual_cal AS commission actual (earned)
,
accounts.balance_deposit_est,
accounts.balance_deposit_actual,
accounts.period,
accounts.sales_id
FROM accounts
LEFT OUTER JOIN users ON accounts.sales_id = users.id
GROUP BY accounts.period, accounts.sales_id
Regards
Richard