November 9, 2005 at 1:34 pm
I got a table imported from Excel by someone with phone number as float so when I select it shows:
1234567890.0
Using Cast or Convert will show:
1.23456e+0
What can I use to show the number as 1234567890?
Thanks.
November 9, 2005 at 1:37 pm
Cast to numeric(10,0)
SQL = Scarcely Qualifies as a Language
November 9, 2005 at 1:41 pm
OR cast it to int
select cast( col as int) phone from table
* Noel
November 9, 2005 at 2:09 pm
thanks.
November 10, 2005 at 12:31 pm
A 10-digit phone # could overflow an int, but casting to bigint, dec(10,0), or char(10) would be safe. STR(phone,10,0) would also work.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply