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
 Money format

Author  Topic 

raddy
Starting Member

12 Posts

Posted - 2008-06-03 : 10:45:09
Hi, I have data in a Payment field:

45.14 - was orig in text format.
Now after converting to money, I see it as this:

45.1400

I need to get rid of the zeros! Anyone please help?

Thanks!

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-06-03 : 10:52:49
Don't use money, use Numeric data type so that you will have control over scale and precision.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

raddy
Starting Member

12 Posts

Posted - 2008-06-03 : 11:01:42
quote:
Originally posted by harsh_athalye

Don't use money, use Numeric data type so that you will have control over scale and precision.




BUt Ive already defined it and the table's quite huge. Is there no other way I can make it look like cents?
Go to Top of Page

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-06-03 : 11:06:13
You have two options.

1) If you are sending data to front-end, handle formatting issue there
2) In the SELECT query, convert to numeric format (adds extra perfomance cost for conversion)

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page
   

- Advertisement -