[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Remove . from value

Posted on 2011-03-24
5
Medium Priority
?
278 Views
Last Modified: 2012-05-11
I need to replace the values in a table that have a value of xxx. with xxx (no decimal)
However if there is a number after the decimal I need to leave it alone.
Example  123. should become 123     but 123.4 should stay 123.4
The feild is type Char(9)
0
Comment
Question by:jtomascak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 2000 total points
ID: 35211575
update tbl
set col = left(col,len(col)-1)
where col like '%.'
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 35211635
update tbl
set col = left(col,len(col)-1)
where rtrim(col) like '%.'
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35211672
update tbl
set col = LEFT(col, CHARINDEX('.',col,0)-1) + RIGHT(col, (LEN(col) - CHARINDEX('.',col,0))
WHERE col like '%.'
0
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35211679
forget my last post i just reread the question
0
 

Author Closing Comment

by:jtomascak
ID: 35211916
That will do it.
this is what happen when you have a Network engineer playing DBA :)

thanks
0

Featured Post

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

656 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