SELECT sum(GoodsRcpt.PurchQty) FROM GoodsRcpt where GoodsRcpt.GlsClr=" WHITE";

SELECT count(Prescriptions.SrNo)/2 FROM Prescriptions where
Prescriptions.GlsClr=" WHITE";

SELECT sum(GlassDamage.DamageQty) FROM GlassDamage where
GlassDamage.GlsClr=" WHITE";

Combine above three query and the equetion should be like, (result of
query1) - ( result of query 2 + result of query 3)

its urgent...
Thank you....

Try the sql below:

select (SELECT sum(GoodsRcpt.PurchQty) FROM GoodsRcpt where GoodsRcpt.GlsClr=" WHITE") - ((SELECT count(Prescriptions.SrNo)/2 FROM Prescriptions where Prescriptions.GlsClr=" WHITE") + (SELECT sum(GlassDamage.DamageQty) FROM GlassDamage where GlassDamage.GlsClr=" WHITE")) AS result;

ACTULY I AM TRYING A QUERY IN MS ACCESS..
IT GIVES ERROR AT " AS RESULT"

I see. Because I normally do that with SQL Server. It has been sometime since I last use MS ACCESS. Give me some time to figure it out.

Some databases don't support multiple queries combined into one.. so you can do nothing with it but execute them separately..

Edited 4 Years Ago by vjcagay: wrong grammar

This question has already been answered. Start a new discussion instead.