Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
kitkit80
Starting Member
2 Posts |
Posted - 2009-11-23 : 07:51:19
|
| Hi,I need to pull the (i)currency exchange rate(EUR) from currency table and (ii)sales amount(which is stored as EUR) from sales table matching the currency key referenced in both tables and then (iii)multiply both values to obtain the amount according to local currency (USD).I am having an uphill battle figuring this out as it all has to be done within one query.Anybody can share your expertise?Thanks,KITKIT80 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-11-23 : 08:16:31
|
| It should be something like thisselect s.sales_amout*e.exchage_rate from sales s inner join exchange_rate as e on s.curreny_id=e.currency_idMadhivananFailing to plan is Planning to fail |
 |
|
|
kitkit80
Starting Member
2 Posts |
Posted - 2009-11-23 : 08:21:12
|
| Thanks Madhivanan,I'll try it out! Cheers! |
 |
|
|
|
|
|