cancel
Showing results for 
Search instead for 
Did you mean: 

Query help - select 2 different prices from ITM1

jane_liang
Participant
0 Kudos
60

Hi all,

I need some assistance with a query.

In a customized query, I need to show the item code and 2 different prices (price from price list 1 and price from price list 2). I am unsure how to do this because the where clause would be different for each price based on the pricelist #. I need to show the information for the item and prices in the same row.

Thanks for any help.

Jane

View Entire Topic
Former Member
0 Kudos

Hi Jane,

Try this one:

SELECT T0.ItemCode, (SELECT Price FROM ITM1 WHERE ItemCode = T0.ItemCode AND PriceList = 1) AS 'Price List 1',

(SELECT Price FROM ITM1 WHERE ItemCode = T0.ItemCode AND PriceList = 2) AS 'Price List 2'

FROM dbo.OITM T0

WHERE T0.ItemCode Like '[%0\]%'

Thanks,

Gordon

jane_liang
Participant
0 Kudos

Thanks Gordon!!!