I am trying to convert decimal numbers into a number without decimals…
Sample Data
All the decimals are two places.
I have used this sql statement to view the data
This pulls back the correct format that I want…but when I try to use the update I get the following error.
Here is my update statement
Does anyone know how I can update these field with the new format?
Thanks
Sample Data
Code:
Now Needs to Be
23.00 2300
68.67 6867
42.36 4236
All the decimals are two places.
I have used this sql statement to view the data
Code:
select table_hours, cast((table_hours * 100) as int) AS NewHours
From table
This pulls back the correct format that I want…but when I try to use the update I get the following error.
Code:
Server: Msg 8115, Level 16, State 8, Line 1
Arithmetic overflow error converting numeric to data type numeric.
The statement has been terminated.
Here is my update statement
Code:
Update TABLE
SET TABLE_HOURS = cast((table_hours * 100) as int)
Does anyone know how I can update these field with the new format?
Thanks