select cast (lat as float) lat,long from cs.cs_location where long <> '' and long is not null and lat<> '' and lat is not null
lat 是字符串纬度信息,都是多少点多少度的,正常情况下是可以转化成FLOAT的。
但该语句出现 非法的varchar 转化 float
但是select count(*) from cs.cs_location where long <> '' and long is not null and lat<> '' and lat is not null and isnumberic(lat)<> 1
记录集为0 ????
请问各位还有什么情况会导致这种原因啊。
lat 是字符串纬度信息,都是多少点多少度的,正常情况下是可以转化成FLOAT的。
但该语句出现 非法的varchar 转化 float
但是select count(*) from cs.cs_location where long <> '' and long is not null and lat<> '' and lat is not null and isnumberic(lat)<> 1
记录集为0 ????
请问各位还有什么情况会导致这种原因啊。
解决方案 »
- 如何把数据插入到数据库表中呢?
- 请教图形设计问题
- FastReport报表中的TfrxDetailData 只显示奇数行
- ★★★★csdn的改革迫在眉睫,支持中国软件与csdn发展的朋友请进,要分的朋友别进,这里不分等级不分贫贱
- 有一个学生表,还有一个学生的成绩表。
- ●●●●●●●●●●●●●这个算是倒分吗?●●●●●●●●●●●●●
- 不好意思,一个比较简单的问题,如何跳出Case语句?
- 关于formula one 6.01 的问题
- 如何增加一个字段?
- 请数据库高手们说一说开发c/s数据库的经验
- 约瑟夫问题:完成下面的程序
- 如何能在XLS文件被Excel打开的情况下(可读可写)的情况,也能通过程序(用ADO连接)去读取XLS文件???
select cast (lat as float) lat,long from cs.cs_location where long <> '' and long is not null and lat<> '' and lat is not null and isnumberic(lat)= 1
服务器: 消息 8114,级别 16,状态 5,行 1
将数据类型 varchar 转换为 float 时出错。
晕死这样子也出错
要不你试一个记录,那条cast一定可行,然后再试试全部记录
SQL server 里没这个函数啊另外where long <> '' and long is not null
where long <> ''已经包含了long is not null 这个条件,所以不用加and long is not null