Thanks Jason. The problem I'm encountering is when I add a SUM function, it only returns 1 record. If I add a GROUP BY function such as the contract ID (npc_id), It doesn't SUM up the column values like my bag quantities (bag_qty). I attached the file I'm working on to the previous post but here is my SQL statement for the recordset I'm looking to get SUM results on.
"SELECT *,SUM(bag_qty) as TotalBags, (bag_qty*bag_weight) as TotalKg, (landed_price*2.2046) as KGprice, (bag_qty*bag_weight*2.2046*landed_price) as TotalContractPrice, Coalesce((twenty_five_paid_ci+spot+seventy_five),0) as BalanceDue FROM npc_contract LEFT OUTER JOIN clients ON npc_contract.client_id=clients.ClientID LEFT OUTER JOIN inventory ON npc_contract.coffee_id=inventory.inventory_id LEFT OUTER JOIN warehouse ON npc_contract.destination_port=warehouse.WarehouseID LEFT OUTER JOIN np_agents ON npc_contract.agent=np_agents.agentID WHERE inventory_year >= '2013' ORDER BY npc_id DESC"
The example above is just testing the SUM function of the bag quantites: SUM(bag_qty) as Total Bags. What I want to be able to do is sum the total values of certain columns after I have preformed a search.
Thanks Jason.