Solved

trim zeros

Posted on 2012-04-03
1
227 Views
Last Modified: 2012-04-03
--default data = 3.125, 6.250, 12.500, 18.750, 50.000

select ID, left(sPercent,charindex('.',sPercent,+2)+2) as sPercent from perSize order by ID asc

--after running above = 3.125, 6.25, 12.50, 18.75, 50.00

--all i want to do is remove all trailing zeros so the data looks like: 3.125, 6.25, 12.5, 18.75, 50
0
Comment
Question by:fwstealer
1 Comment
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 37801447
Try:

select ID, cast(sPercent as float) as sPercent from @perSize order by ID asc
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
export all data from one table to multiple text files 4 69
SQL Query Assistance 4 31
Service Statictic 11 14
SqlAdvisor 2016 3 11
In this article I will describe the Detach & Attach 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 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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 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

12 Experts available now in Live!

Get 1:1 Help Now