AnsweredAssumed Answered

Using ExecuteSQL to sum a record in another table

Question asked by jeremy_oz on Apr 21, 2018
Latest reply on Apr 22, 2018 by erolst

Hi I am trying to use ExecuteSQL to perform a simple sum of record in a table and clearly I cannot seem to get it to work so I am missing something basic


So I have a field in a table called total_qty_received


I have another table name po_item_receipts that has a number field names po_qty_received


I would like to sum of the po_qty_received and store it in the first table in the field total_qty_received


I have tried a number of formats from the forum but non seem to work for me


ExecuteSQL ("Sum po_qty_received from po_item_receipts" ;"" ; "")


once I get the above to work I would like to add some selection criteria


Were PO_number = $Po_Number and part_number = $Part_Number


I would like to SQL expression to be stored in a calculated field so that it updates automatically.


any assistance would be much appreciated.


Many thanks