Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i have three table "Receipt", "Issue", "Total"

"Reciept" table have columns SlNo(Auto), ProductName, Quantity, Date

"Issue" table have columns SlNo(Auto), ProductName, Quantity, Date

"Total" table have columes SlNo(Auto), ProductName, RecieptTotal, IssueTotal, Balance

Summing in "Issue" table using "Quantity " column and updating "Total " Table " IssueTotal " column sSQL=update "Total" set "Total"."IssueTotal" = SELECT SUM( "Issue"."Quantity" ) FROM "Issue" where "Issue"."ProductName"="Total"."ProductName" GROUP BY "Issue"."ProductName"; it works and update "Total"."IssueTotal"

summing in" Reciept" table using "Quantity " column and updating "Total " RecieptTotal" column sSQL=update "Total" set "Total"."RecieptTotal" = SELECT SUM( "Reciept"."Quantity") FROM "Reciept" WHERE "Total"."ProductName" = "Reciept"."ProductName" GROUP BY "Reciept"."ProductName"; it works and update "Total"."RecieptTotal"

now i using only "Total" table updated "Total"."RecieptTotal" and "Total"."IssueTotal" for "Balance"

sSql=SELECT "RecieptTotal" - "IssueTotal" AS "Balance" FROM "Total"

This SELECT stament works but when UPDATE INTRODUCED then returns error .. Single value expected

sSQL=update "Total" set "Total"."Balance" = SELECT "RecieptTotal" - "IssueTotal" FROM "Total"

i am stuck....pls help )