[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • 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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

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