Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Special MONEY format needed for SQL Server

Posted on 2007-03-26
2
Medium Priority
?
2,424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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 shrink a transaction log file down to a reasonable size.

609 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