Solved

Special MONEY format needed for SQL Server

Posted on 2007-03-26
2
2,412 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
Comment Utility
SELECT  RIGHT(REPLICATE('0',9) + REPLACE(CAST(moneyColumn AS VARCHAR),'.',''),9)
from urTable
0
 
LVL 32

Author Comment

by:jhance
Comment Utility
Thanks!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now