Solved

SQL Server 2005 and padding zeroes

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
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

746 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

9 Experts available now in Live!

Get 1:1 Help Now