Solved

SQL Server 2005 and padding zeroes

Posted on 2013-01-29
3
224 Views
Last Modified: 2013-01-29
I have a field that is Numeric(8,4)

When a value is 40.25

How do I desplay as
00402500
0
Comment
Question by:lrbrister
[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
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 38831637
SELECT RIGHT('0000'+ cast( CAST(yourNumber*10000 as int) as varchar ) ,8)
0
 

Author Closing Comment

by:lrbrister
ID: 38831723
aneeshattingal,
 That's why you get the big money!
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 38831742
:)
0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

734 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