Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting data in one field from integer to decimal 1

Status
Not open for further replies.

Cenedra

Programmer
Jan 2, 2003
114
US
Hi all,

I converted some legacy data into a SQL Server database. When I inserted data, I thought I was getting whole numbers. Unfortunately, that wasn't the case, so I inserted whole numbers into this particular field.

For example, in the legacy data, I had the value 200, and it is now in my SQL Server database as 200.00. Unfortunately, this is supposed to be 2.00.

Is there a way that I can move the decimal over two places to the left in a SQL Query so that my values will be correct?

Any help is appreciated,
Cen
 
If you got 200 and need 2.00 then simply divide number by 100. :)

------
heisenbug: A bug that disappears or alters its behavior when one attempts to probe or isolate it
schroedinbug: A bug that doesn't appear until someone reads source code and realizes it never should have worked, at which point the program promptly stops working for everybody until fixed.

[ba
 
Well.... duh on my part there. Having all sorts of problems and not thinking clearly there :)

Can I do that in a query? Or do I need to write a program to do it?
 
Well I really think I need some coffee.

This worked:

update clients set maoverage=(maoverage / 100)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top