Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 e values to normal vaules

Author  Topic 

skybvi
Posting Yak Master

193 Posts

Posted - 2011-06-30 : 12:05:00
Hi,
I just converted a column data type from float to char..
I am getting e values in hte column
for example...1500007135 is represented as 1.50001e+009
How can i fix this.


Regards,
Sushant
DBA
West Indies

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-06-30 : 12:13:40
convert it to an int first, and then char.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

skybvi
Posting Yak Master

193 Posts

Posted - 2011-06-30 : 12:43:30
when i try to convert it to int , error comes ---
'PLU1' table
- Unable to modify table.
Arithmetic overflow error for type int, value = 2150000036.000000.
The statement has been terminated.


Regards,
Sushant
DBA
West Indies
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-06-30 : 12:51:43
Then convert it to a bigint instead.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

skybvi
Posting Yak Master

193 Posts

Posted - 2011-06-30 : 13:02:19
I converted to bigint, but when i try to convert bigint to char
error says :---

'PLU1' table
- Unable to modify table.
Arithmetic overflow error converting expression to data type varchar.
The statement has been terminated.


Regards,
Sushant
DBA
West Indies
Go to Top of Page

jimf
Master Smack Fu Yak Hacker

2875 Posts

Posted - 2011-06-30 : 13:23:31
What exact data type type are you trying to convert to and can you provide some sample data that you are trying to convert?

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

skybvi
Posting Yak Master

193 Posts

Posted - 2011-06-30 : 13:26:59
i want to convert float to char
I converted float to bigint successfully.

I have a query wich compares columns from 2 tables
both(columns) are numbers...
but one datatype is char and other bigint(just now converted)
So wen i run that query
column1=column2
it says :---
Msg 8114, Level 16, State 5, Line 1
Error converting data type varchar to bigint.



Regards,
Sushant
DBA
West Indies
Go to Top of Page
   

- Advertisement -