on 2009 Nov 14 3:23 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
113 | |
8 | |
6 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.