Hi all,
I have a TABLE that contain a number of records, each record has a field called "master_ecn_id".
I want to run a QUERY that results in a record set that only contain the records for the selected "master_ecn_id"
$ecn could be any one of three ID numbers.
This what I have:
SELECT master_agent_ecn, SUM(final_net_value_t1), SUM(final_net_value_t2), SUM(final_net_value_t3),
SUM(final_vat_value_t1), SUM(final_vat_value_t2), SUM(final_vat_value_t3),
SUM(final_sales_value_t1), SUM(final_sales_value_t2), SUM(final_sales_value_t3),
SUM(commission_due_t1), SUM(commission_due_t2), SUM(commission_due_t3)
FROM sales_commission
WHERE master_agent_ecn = $ecn AND paid_t1 = 0 OR paid_t2 = 0 OR paid_t3 = 0
GROUP BY master_agent_ecn
Because I am GROUP BY "master_ecn_id" the recordset contains all the records with the SUMMED fields.
Is there a way I can just extract the records that = the "master_ecn_id".
Thanks for any help you can give.