Db.Execute "delete from B " & _
" where KH='" & fg.TextMatrix(i, 2) & "' " & _
" and dttime between (select min(dttime1) from A where KH='" & fg.TextMatrix(i, 2) & "' and dttime2 = '" & fg.TextMatrix(i, 1) & "') " & _
" and (select max(dttime2) from A where KH='" & fg.TextMatrix(i, 2) & "' and dttime2 = '" & fg.TextMatrix(i, 1) & "') " 我想 " where KH='" & fg.TextMatrix(i, 2) & "' " & _ 在这句的KH=后面加个-号
让他变成" where KH=-'" & fg.TextMatrix(i, 2) & "' " & _ 这样子
不过这个在ACCESS数据库上能用,在SQL上确不行。
要如何才能加上那个-号。
" where KH='" & fg.TextMatrix(i, 2) & "' " & _
" and dttime between (select min(dttime1) from A where KH='" & fg.TextMatrix(i, 2) & "' and dttime2 = '" & fg.TextMatrix(i, 1) & "') " & _
" and (select max(dttime2) from A where KH='" & fg.TextMatrix(i, 2) & "' and dttime2 = '" & fg.TextMatrix(i, 1) & "') " 我想 " where KH='" & fg.TextMatrix(i, 2) & "' " & _ 在这句的KH=后面加个-号
让他变成" where KH=-'" & fg.TextMatrix(i, 2) & "' " & _ 这样子
不过这个在ACCESS数据库上能用,在SQL上确不行。
要如何才能加上那个-号。
解决方案 »
- 正则表达式
- 如何判断GATAGRID内是否有内容?
- vb如何调用一个创建存储过程的脚本文件(该文件只包含一个存储过程)来在数据库中生成一个存储过程,客户端没装sql,不能调用SQLDMO
- 高分请教
- 請問那位有XP風格的button﹐但是可以輸入圖片呀?
- 有哪位有用API实现修改打印机纸张大小以及横向或纵向设置的源代码啊.
- 菜鸟请教大虾——如何实现控件的移动等功能(在线等待)
- 关于服务器端和客户端有一问
- 100 分的数据环境问题。
- 字符串函数????帮忙呀!
- 请大家帮忙看看这句话有错吗?运行到这里说insert into语句的语法错误,为什么
- 高手帮帮忙!我的程序在调试时正常 在编译后不能完全关掉
我是想这样子的
本来在A表选中的记录
比如为-123456
然后B表的记录只为123456
然后这样子在前面加个-号会让B表的123456 认为-123456
在ACCESS上" where KH=-'" & fg.TextMatrix(i, 2) & "' " & _ 这样子是可以的
在SQL就会出现
实时错误'-2147217900 (80040e14)
对数据类型而言运算符无效。运算符为minus,类型为varchar。
" where KH=-" & fg.TextMatrix(i, 2) & " "