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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Converting foreign money strings

Author  Topic 

MrWilliams
Starting Member

1 Post

Posted - 2012-01-25 : 12:35:16
Hi guys,

I’m a bit stuck on something

The French way of writing £69.69 is 66,69

I need a way in SQL server to return 66.69 for this value

I have tried:

select CAST('66,69' as money)

but this returns 6669.00 – not the desired output

Replacing the , with a . is not a solution because that won’t work for all currency formats (it needs to work for all regional settings not just FR).

Any ideas?

Thanks for any help

Simon

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-01-25 : 13:13:41
This type of formatting should be done in your application and not in T-SQL. It is much easier to format data in the application and just return the raw data from SQL. Your application programming language should have easy ways to format this.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -