Solved

Special MONEY format needed for SQL Server

Posted on 2007-03-26
2
2,414 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

895 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

16 Experts available now in Live!

Get 1:1 Help Now