• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

I need help with percentages in my SQL Server Query

How do I turn varchar value 05600000 into the percentage value 5.6 in my SQL Server 2012 query?  Thank you very much in advance.

mrotor
0
mainrotor
Asked:
mainrotor
2 Solutions
 
Anthony PerkinsCommented:
Something like this perhaps:
DECLARE @Value varchar(20) = '05600000'
SELECT CAST(@Value AS numeric(18,2)) / 1000000
0
 
Surendra NathTechnology LeadCommented:
SELECT CAST('05600000' AS DECIMAL(18,2))/100000

Open in new window

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

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