Good day,
I am having a probem with my sql. I want to create a formula for my pivot field.. here is my code...
SELECT
*
FROM
(
SELECT
REPORT.MATERIAL
,REPORT.Description
,REPORT.Material_Type
,REPORT.ATP_check
,REPORT.Delivering_Plant
,REPORT.Order_Quantity
,REPORT.Held_by_Finance
,REPORT.Rejected_OOS
,REPORT.Rejected_Others
,REPORT.Open_Order_Quantity
,REPORT.Order_Quantity_NKA
,REPORT.Order_Quantity_RKA
,REPORT.Order_Quantity_Others
,REPORT.Stock
,REPORT.DSD_Delivery
,REPORT.OUtBound_Haulage
,REPORT.Total_OutBound_items
,REPORT.InBound_Haulage
,REPORT.Haulage_In_Transit
,REPORT.Process_Order
,REPORT.Total_Inbound_Items
,REPORT.Custom_Haulage_In_Transit
,REPORT.Custom_Inbound_Haulage
,REPORT.Custom_Process_Order
,REPORT.Custom_Total_Inbound
,REPORT.Custom_ATP_Quantity
,TYPES.*
FROM CO09_Report REPORT
INNER JOIN TBLTYPES TYPES
ON REPORT.MATERIAL = SUBSTRING(TYPES.TXTMATERIAL,13,18)
--WHERE REPORT.Custom_ATP_Quantity > 0
)AS T
PIVOT (SUM(PERCENTAGE)
FOR [TYPE] IN ([IN TRANSIT], [HAULAGE], [PRODUCTION]))
AS pvt
my problem is that how can i multiply REPORT.Haulage_In_Transit to [IN TRANSIT] that is located in the pivot
can anyone has an idea about this..?
thanks