Here is the link to download my database with sample data (Management Inventory): http://www.mediafire.com/?9o5ycrqot2risa8
I am making a query to access redundant or missing quatity of material.
Report
MatId CusMatName TDK NTK XTK ...
. .
. .
. .
. .
with: TDK:
select detail.MatId as ID_Nhap, SUM(Quantity) as SL_Nhap from InventoryTransDetail detail join InventoryTransHeader header
ON detail.InvTransHeaderId = header.InvTransHeaderId
where header.InvTransTypeId = 'IN1' and header.InvTransAccDate between '2011-02-01' and '2011-03-01' GROUP BY detail.MatId
[Condition: period in 2011-02-01 and 2011-03-01]
NTK:
select detail.MatId, SUM(Quantity) from InventoryTransDetail detail join InventoryTransHeader header
ON detail.InvTransHeaderId = header.InvTransHeaderId
where header.InvTransTypeId = 'OU1' and header.InvTransAccDate between '2011-02-01' and '2011-03-01' GROUP BY detail.MatId
[Condition: period in 2011-02-01 and 2011-03-01]
XTK: SUM(NTK)-SUM(XTK) [Condition: period before 2011-02-01] (Not done)
Then to do is save all the results on an object and then output the result (select statement) - resulting in the above table.
I have to do this how?
I wish to receiving your help!!!!