• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2430
  • Last Modified:

Special MONEY format needed for SQL Server

I have a field in SQL Server that is a MONEY value but I need it formatted like XXXXXXXXX.  So a value like 123.45 would be 000012345.  Basically it's left-zero filled, w/o the decimal point.
0
jhance
Asked:
jhance
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT  RIGHT(REPLICATE('0',9) + REPLACE(CAST(moneyColumn AS VARCHAR),'.',''),9)
from urTable
0
 
jhanceAuthor Commented:
Thanks!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now