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.
Author |
Topic |
sanjay5219
Posting Yak Master
240 Posts |
Posted - 2014-08-15 : 10:52:14
|
Hi All,I have one column phone float now I have to remove 1144 from startingI can not run substring query please suggest9740084226974008422711449964743899 |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-08-15 : 14:29:59
|
Why is a phone number stored as a float?select cast(cast(11449964743899 as float) as bigint) % 11440000000000 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-08-18 : 05:22:37
|
quote: Originally posted by gbritton Why is a phone number stored as a float?select cast(cast(11449964743899 as float) as bigint) % 11440000000000
This is enoughselect cast(cast(11449964743899 as float) as bigint) % 10000000000MadhivananFailing to plan is Planning to fail |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2014-08-18 : 05:23:47
|
quote: Originally posted by sanjay5219 Hi All,I have one column phone float now I have to remove 1144 from startingI can not run substring query please suggest9740084226974008422711449964743899
You should use VARCHAR datatype to store it and use right functionselect right(phone,10) from tableMadhivananFailing to plan is Planning to fail |
|
|
|
|
|