急!!!在线等待

chen_2001 2003-10-20 04:17:23
我在vb中用到以下一条sql语句,但每次执行都报错,谁能帮我解决这个问题,必给高分
insert into table1(name,id,type) select name as 'name',id as 'id',type as 'type' from table2 where T1date>=date1 and T1date<=date2
...全文
27 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
feiqinfeiwhw 2003-10-21
  • 打赏
  • 举报
回复
同意楼上众位的观点!
sdhdy 2003-10-20
  • 打赏
  • 举报
回复
--不用加别名,可能是日期类型的问题
insert into table1(name,id,type) select name ,id ,type from table2 where T1date>=date1 and T1date<=date2
sambr 2003-10-20
  • 打赏
  • 举报
回复
同意楼上的观点
BraveHorse 2003-10-20
  • 打赏
  • 举报
回复
insert into table1(name,id,type) values(select name as 'name',id as 'id',type as 'type' from table2 where T1date>=date1 and T1date<=date2)
如果是access则:
insert into table1(name,id,type) values(select name as 'name',id as 'id',type as 'type' from table2 where datediff("d",T1date,date1)<=0 and datediff("d",T1date,date2)>=0
shaidanR 2003-10-20
  • 打赏
  • 举报
回复
提示错误信息是what?
sword281 2003-10-20
  • 打赏
  • 举报
回复
你的数据库是access吗?t1date是何类型(是日期型吗?),date1,及date2从何而来

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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