1

I am looking to put a comma after two digits from right. For example i have 250$ and in SQL I want the select to return 2,50$. Example2: 500$ should be 5.00$. For 1000$. It should be 10,00$. How can it be done in select. I have a column that holds those value in my SQL database. Thanks you in advance for your help. My column data type is bigint

a_horse_with_no_name
  • 497,550
  • 91
  • 775
  • 843
Blessed
  • 45
  • 6

1 Answers1

0

Ironically, you can do this the same way in almost any database:

select cast( (col / 100.0) as decimal(20, 2))
Gordon Linoff
  • 1,198,228
  • 53
  • 572
  • 709
  • Wow, Thanks million... your syntaxe resolved my issue.................. – Blessed Apr 10 '17 at 13:06
  • I was solving my issue in the way that was very complicated but here you gave me an easy answer i never thought about. Thanks Gordon Linoff – Blessed Apr 10 '17 at 13:07