Click here to Skip to main content
15,905,593 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to conver float number type to local money format but SQL SERVER not accept my convert function.

Here My Converting solution:

SQL
FORMAT(360.3678,'c','tr-TR')


So output should like this:

36.036,78


But its getting error with this:

SQL
'FORMAT' is not  recognized built-in function name.


How can I solve this issue?

Thanks
Posted
Comments
Tomas Takac 27-Feb-15 3:44am    
FORMAT[^] is only supported in SQL Server 2012 or newer.
Maciej Los 27-Feb-15 3:50am    
No, Tomas, you're wrong. Format is known for MS SQL Server 2008 and up.
Sorry, i'm wrong ;)
Tahsin Çetin 27-Feb-15 3:46am    
OK have you got any solution?

FORMAT function is available from version 2012 onwards. In earlier versions, use this

convert(money,round(360.3678,2)) or cast(360.3678 as money)
 
Share this answer
 
v3
As Tomas Takac[^] mentioned, Format function is supported in SQL Server 2012 and newer.

The only way to achieve that, is to write custom function[^] which return a text formated the way you want.

See also: CAST and CONVERT[^] and STRING functions[^]

Try!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900