Skip to Content
0
May 10, 2010 at 08:02 PM

Help on query

18 Views

Hello experts

One question for a query I am having problems

My company makes dscount group based on item properties, so different property fidderent discount.now I need to have a table showing all pricing per customer

I have tried to start the query but I really need support I believe the Object key number is equal to the item property number

SELECT

CASE T2.[ItemCode], T3.[ItemName], T2.[Price], T4.[Discount] when T3.[QryGroup1]='Y' AND T4.[ObjKey]=1 FROM OCRD T0 INNER JOIN OPLN T1 ON T0.ListNum = T1.ListNum INNER JOIN ITM1 T2 ON T1.ListNum = T2.PriceList INNER JOIN OITM T3 ON T2.ItemCode = T3.ItemCode INNER JOIN OSPG T4 ON T0.CardCode = T4.CardCode WHERE T0.[CardCode] =[%0] END

CASE T2.[ItemCode], T3.[ItemName], T2.[Price], T4.[Discount] when T3.[QryGroup2]='Y' AND T4.[ObjKey]=2 FROM OCRD T0 INNER JOIN OPLN T1 ON T0.ListNum = T1.ListNum INNER JOIN ITM1 T2 ON T1.ListNum = T2.PriceList INNER JOIN OITM T3 ON T2.ItemCode = T3.ItemCode INNER JOIN OSPG T4 ON T0.CardCode = T4.CardCode WHERE T0.[CardCode] =[%0] END