Author |
Topic |
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2008-04-09 : 11:19:33
|
HaiI have amount field in my table as decimal. I need a query to display the amount with dollar or euro symbol based on country selection. The country also in same table.For example If country is US then Amount $1200, If country is UK then Amount €1200.Thanks in advance. |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-09 : 11:33:41
|
I think it will be better for you to do this it at front end. Most front end applications have currency formatting functions which provides you with result in desired currency. What is front end you are using? |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-04-09 : 11:35:45
|
doesn't UK stil use pounds and not euros?but yes this should be done in the front end like visakh16 said_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
|
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2008-04-09 : 12:35:46
|
Thanks. I am using vb.net, and I get the result and bind in a grid. So from front end it is some difficulties.kamal. |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-04-09 : 12:41:33
|
No. Use the FORMAT property for the GRID and you're set. E 12°55'05.25"N 56°04'39.16" |
|
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2008-04-09 : 13:07:36
|
I'm using asp.net gridview. How can I use FORMAT property, kindly help me. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-04-09 : 13:12:53
|
Use FormatCurrency() functionhttp://msconline.maconstate.edu/tutorials/VBNET/VBNET01/vbnet01-08.aspx |
|
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2008-04-09 : 14:53:57
|
Thanks. above link is very useful.But I written the stored procedure to add the $ or € symbol by using CASE functionality in SQL server.So how to merge the symbol to the amount field. |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2008-04-09 : 15:19:09
|
for the last time kamal:DO this in the front end!_______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenpSSMS Add-in that does a few things: www.ssmstoolspack.com |
|
|
kamal.A
Yak Posting Veteran
70 Posts |
Posted - 2008-04-09 : 15:41:51
|
Ok Thanks. I will do it from front end. |
|
|
blindman
Master Smack Fu Yak Hacker
2365 Posts |
Posted - 2008-04-09 : 16:30:27
|
And the reason why, Kamal, is that the only way to prepend the currency symbol to the value is by converting the value to a string. And once you do that, it may look pretty but it can no longer be added, subtracted, averaged, or used in any mathematical calculation. So the database should supply actual values and then let the front end format them or manipulate them however it wants.e4 d5 xd5 Nf6 |
|
|
|