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 |
volyn
Starting Member
30 Posts |
Posted - 2010-03-27 : 09:47:19
|
Hello, I face issue with table with inconsistent values in one column. There are orders in our local currency and orders in USD currency. Result of the report will be grouped informations about clients ordering between @startdate and @enddate parameters. Problem is, that result has to be in one currency (one client could have done orders). Exchange rate is each day different and I want to let report user to set parameter @Exchange_rate. Problem is, that I dont know how to multiply USD values with @Exchange_rate parameter value.Code below is not working. CASE WHEN Currency = 'USD' THEN Order_value*@Exchange_rate ELSE Order_value END Order_value_local_currency Is it possible to do it somehow? I dont want to have fixed exchange rate and I also dont want to be asked each week for correction of that value. Thanks for any help. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-27 : 11:07:44
|
it should beOrder_value * CASE WHEN Currency = 'USD' THEN @Exchange_rate ELSE 1 END AS Order_value_local_currency------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
volyn
Starting Member
30 Posts |
Posted - 2010-03-27 : 17:32:53
|
Thanks a lot, working |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-03-28 : 02:37:51
|
welcome------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|