このクエリはありますが、CustomerRefを行と列に変換できませんでした。
SELECT T0.[DocDueDate],
T0.[CardName],
T0.[NumAtCard],
T0.[DocNum],
T1.[ItemCode],
T1.[Dscription],
T3.[WhsCode],
T3.[OnHand] - SUM(OpenQty) OVER (Partition By T1.ItemCode ORDER BY DocDueDate, LineNum, NumAtCard, DocNum) + SUM(T1.OpenQty) AS 'Available',
SUM(T1.[Quantity]) AS 'PO QTY',
SUM(T1.OpenQty) AS 'To Release'
FROM
ORDR T0
INNER JOIN RDR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN OITM T2 ON T1.[ItemCode] = T2.[ItemCode]
INNER JOIN OITW T3 ON T2.[ItemCode] = T3.[ItemCode] AND T1.[WhsCode] = T3.[WhsCode]
WHERE
T0.[CardCode] = 'c00192' and
T0.[DocStatus] = 'O' AND
T1.[LineStatus] = 'O' AND
T0.[CANCELED] = 'N' AND
T1.[WhsCode] = '161'
GROUP BY
T0.[DocDueDate],
T0.[CardName],
T0.[NumAtCard],
T0.[DocNum],
T1.[ItemCode],
T1.[Dscription],
T3.[OnHand],
T3.[WhsCode],
T1.[LineNum],
T1.OpenQty
ORDER BY
T0.[DocDueDate],
T0.[NumAtCard],
T0.[DocNum]
これまでに何を試みましたか?あなたのコードはどこですか? – Akaino