declare @rate as int
select h.customer,h.order_no,(d.val/@rate) as euro_sales,c.currency from scheme.opheadm h with(nolock)
left join scheme.opdetm d on d.order_no = h.order_no
left join scheme.slcustm c on c.customer = h.customer
case when (c.currency ='EUR') then @rate = '1.11'
else @rate ='0'
where h.status in (1,2,3,4,5,6,7,8) and h.status <> 'Q'
|