Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

using subtracting two quantity of a table but not proper result

i have three table "Receipt", "Issue", "Total". "Reciept" table columns SlNo(Auto), ProductName, Quantity, Date "Issue" table columns SlNo(Auto), ProductName, Quantity, Date "Total" table columes SlNo(Auto), ProductName, RecieptTotal, IssueTotal, Balance summing ProductName wise of Reciept table and updating "Total " RecieptTotal column sSQL=update "Total" set "Total"."IssueTotal" = SELECT SUM( "Issue"."Quantity" ) FROM "Issue" where "Issue"."ProductName"="Total"."ProductName" GROUP BY "Issue"."ProductName"; summing ProductName wise of Issue table and updating "Total " IssueTotal column update "Total" set "Total"."RecieptTotal" = SELECT SUM( "Reciept"."Quantity") FROM "Reciept" WHERE "Total"."ProductName" = "Reciept"."ProductName" GROUP BY "Reciept"."ProductName"; Till here its update Total table as column wise but when sSQL=update "Total" set "Total"."Balance" =SELECT SUM( "Reciept"."Quantity" - "Issue"."Quantity" ) FROM "Issue", "Reciept" WHERE "Reciept"."ProductName"= "Issue"."ProductName" GROUP BY "Total"."ProductName"; Two ProductName-Jute(150), Paper(126) under "Reciept"."Quantity" and Jute(82), Paper(67) under "Issue"."Quantity" but "Total"."Balance" for Jute(128) and Paper(128) not shows proper result . i am stuck....pls help )