Solved

SQL Server 2005 and padding zeroes

Posted on 2013-01-29
3
223 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
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

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.
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how the fundamental information of how to create a table.

685 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