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.

Member Avatar for vjcagay

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

okay thank you all...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.