Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9071

Re: Purchase Price Comparison by Items

$
0
0

Hi,

 

Try this query and let me know whether it meets your purpose:

 

SELECT t0.docdate,T0.[DocNum] as Doc#, T0.[NumAtCard] as VendorRef,T0.[CardName] as 'Vendor Name', T1.[ItemCode] as Part#, T1.[Dscription] as Descr, T1.[Quantity] as OrdQty,

case when month(T0.[DocDate]) = '1' then  T1.[Price]  end as  'Jan',
case when month(T0.[DocDate]) = '2' then T1.[Price]end as  'Feb',
case when month(T0.[DocDate]) = '3' then T1.[Price] end as  'Mar',
case when month(T0.[DocDate]) = '4' then T1.[Price] end as  'April',
case when month(T0.[DocDate]) = '5' then T1.[Price] end as  'May',
case when month(T0.[DocDate]) = '6' then T1.[Price] end as  'June',
case when month(T0.[DocDate]) = '7' then T1.[Price] end as  'July',
case when month(T0.[DocDate]) = '8' then T1.[Price] end as  'Aug',
case when month(T0.[DocDate]) = '9' then T1.[Price] end as  'Sept',
case when month(T0.[DocDate]) = '10' then T1.[Price] end as  'Oct',
case when month(T0.[DocDate]) = '11' then T1.[Price] end as  'Nov',
case when month(T0.[DocDate]) = '12' then T1.[Price] end as  'Dec'

FROM OPOR T0  INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry WHERE  t1.itemcode = [%0] and t0.docdate between [%1] and [%2] and T1.[LineStatus] = 'C' and T0.[CANCELED]  = 'N' ORDER BY T0.DOCDATE

 

Thanks & Regards,

Nagarajan


Viewing all articles
Browse latest Browse all 9071


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>