Solved

Remove . from value

Posted on 2011-03-24
5
272 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
5 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

713 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