求助,紧急!!!

yuansheng_521 2010-01-20 09:52:43
这样的数据:
time_sum
2小时58分53秒
0小时33分13秒
0小时 0分14秒
28小时15分25秒
16小时33分42秒
0小时 0分43秒

数据类型是“文本”
我想取“小时”之后的字符串,该怎么写??
select right(time_sum,instr(time_sum,"小时")+1) from table
这样写不对么???
错在哪里啊 ?
为什么数据都是乱七八糟的?


...全文
50 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuansheng_521 2010-01-20
  • 打赏
  • 举报
回复
哦了 终于搞定了 谢谢
wwwwb 2010-01-20
  • 打赏
  • 举报
回复
select mid(time_sum,instr(time_sum,"时")+1),* from data_time_tem
where
iif(time_sum is not null,
cint(left(time_sum,instr(time_sum,"小时")-1)) > 1,0)
order by time_sum
yuansheng_521 2010-01-20
  • 打赏
  • 举报
回复
http://www.access911.net/csdn/filedescription.asp?mdb=2010-1-20&id=32&mode=3
传了
wwwwb 2010-01-20
  • 打赏
  • 举报
回复
上传你的MDB到www.access911.net/csdn
只要有问题的表、查询,用WINRAR压缩
yuansheng_521 2010-01-20
  • 打赏
  • 举报
回复
查了 没发现问题饿
wwwwb 2010-01-20
  • 打赏
  • 举报
回复
检查字段内容是否有不规范 OR NULL
yuansheng_521 2010-01-20
  • 打赏
  • 举报
回复
哦 这样啊
那这个
select mid(time_sum,instr(time_sum,"小时")) from data_time_tem
where cint(left(time_sum,instr(time_sum,"小时")-1)) > 1

为什么会说
“标准表达式中数据类型不匹配”
time_sum是文本型的 用cint 转不可以么???
ACMAIN_CHM 2010-01-20
  • 打赏
  • 举报
回复
select mid(time_sum,instr(time_sum,"小时")+1) from table

RIGHT换成MID,你的 INSTR返回的是小时的位置。不是从右起的位置。
wwwwb 2010-01-20
  • 打赏
  • 举报
回复
select mid(time_sum,instr(time_sum,"小时")+2) from tt2
yuansheng_521 2010-01-20
  • 打赏
  • 举报
回复
没人帮忙啊 快点啊
求助!!!!!!!!!!

7,732

社区成员

发帖
与我相关
我的任务
社区描述
Microsoft Office Access是由微软发布的关系数据库管理系统。它结合了 MicrosoftJet Database Engine 和 图形用户界面两项特点。
社区管理员
  • Access
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧