Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 232
  • Last Modified:

SQL Server 2005 and padding zeroes

I have a field that is Numeric(8,4)

When a value is 40.25

How do I desplay as
00402500
0
lrbrister
Asked:
lrbrister
  • 2
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
SELECT RIGHT('0000'+ cast( CAST(yourNumber*10000 as int) as varchar ) ,8)
0
 
lrbristerAuthor Commented:
aneeshattingal,
 That's why you get the big money!
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
:)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now