0

Sorry for my bad english!
Well, my problem is this:

I have 2 tables: "Standby" and "Usage".
Standby store all the equipements.
Usage store the times that the equipement is used (replaced) and received (placed) in Standby.

My problem is there:

Select Standby.PartNº,Standby.Stock1, Standby.Stock1 - (SUM([Usage].Quant_Used)-SUM([Usage].Quant_Received)) as [No Exterior], Standby.Area from [Usage] RIGHT JOIN Standby ON [Usage].PartNº=Standby.PartNº GROUP BY Standby.PartNº,Standby.Area,Standby.Stock1

this code is working BUT in some equipments (Standby.PartNº is the equip id) that have no corresponde in Usage table it dont calcule anything like:
PartNº Stock1(total) NO Exterior Area
001 2 aab
002 2 1 aab
003 3 2 1bb
004 2 2 avv

in partn=001 this is no rows with that partn so it send nothing?!

i had this code but it send me error:
Select Standby.PartNº,Standby.Stock1, Standby.Stock1 - (SUM(ISNULL([Usage].Quant_Used),0)-SUM(ISNULL([Usage].Quant_Received),0)) as [No Exterior], Standby.Area from [Usage] RIGHT JOIN Standby ON [Usage].PartNº=Standby.PartNº GROUP BY Standby.PartNº,Standby.Area,Standby.Stock1
1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by fabio533
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.