Solved

Special MONEY format needed for SQL Server

Posted on 2007-03-26
2
2,418 Views
Last Modified: 2008-01-09
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
Comment
Question by:jhance
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 250 total points
ID: 18796665
SELECT  RIGHT(REPLICATE('0',9) + REPLACE(CAST(moneyColumn AS VARCHAR),'.',''),9)
from urTable
0
 
LVL 32

Author Comment

by:jhance
ID: 18796834
Thanks!
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how the fundamental information of how to create a table.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question