I am using an openquery to an Oracle server to get information from BaaN ERP.
My request is to get the information of an item and all the locations where the item has stock, and show the information in a gridview, as you can see in the attached image.
For example: I have item CIS-11-2846-01 in warehouse 1, 2, 3 and 4.
In warehouse 1 I have 100 pieces located in R1, warehouse 2 has 5000 pieces located in R1-A, warehouse 3 has 5000 pieces located in R2-B and warehouse 4 has 1000 pieces located in R5-Z.
I managed to make a query that returns all the locations and actual stock for that item, but I have no idea on how to make the "row header" to show the Item number with the production estimated qty. (The blue remark in the picture)
Edit
My actual query is as follows:
SELECT * FROM OPENQUERY
(am3p1, 'SELECT o.T$PDNO, REPLACE(o.T$SITM,'' '','''')T$SITM, o.T$CWAR, o.T$QUNE, o.T$CPES$1, w.T$LOCA, w.T$STKS FROM baan.tticst001305 o
INNER JOIN baan.twhinr140305 w ON REPLACE(o.T$SITM,'' '','''') = REPLACE(w.T$ITEM,'' '','''')
WHERE o.T$PDNO = ''2GE000632'' AND w.T$LOCA <> '' '' ORDER BY o.T$SITM, w.T$IDAT')