Blue
White
Purple
Green
Red
Orange
Blue Light
White Light
Purple Light
Green Light
Red Light
Orange Light
Hi All,I have a Master /Detail Table and using PHPRUNNER 8.1I want to sum value from Detail table to Update one field of Master Table.Master Table : field Name = Inv_totalDetail Table: Select SUM(Qty*Rate) AS Inv_tot from DetailWhat would be the script and where to be place.
Here is the sample code below. You can use it in AfterAdd/AfterEdit event of details table.
$sum = DBLookup("Select SUM(Qty*Rate) AS Inv_tot from Detail where MasterTableID=".$values["MasterTableID"]);CustomQuery("Update MasterTable set inv_tot=".$sum." where MasterTableID=".$values["MasterTableID"]);
There are some missing parts here like master table name, or names of link fields from both master and details.