rsDeptS.Open "select dept_dsc,asset_name,area_num from Asset_use union all select dept_dsc,asset_name,area_num from asset_add" & _
"where datepart(yyyy,pur_date)>=" & strYear1 & " and datepart(yyyy,pur_date)<=" & strYear2 & _
"and datepart(mm,pur_date)>=" & strMon1 & " and datepart(mm,pur_date)<=" & strMon2 & _
"order by dept_dsc", gcnGDmis这个句子在SQL中可以运行,为什么在VB中不可以???
"where datepart(yyyy,pur_date)>=" & strYear1 & " and datepart(yyyy,pur_date)<=" & strYear2 & _
"and datepart(mm,pur_date)>=" & strMon1 & " and datepart(mm,pur_date)<=" & strMon2 & _
"order by dept_dsc", gcnGDmis这个句子在SQL中可以运行,为什么在VB中不可以???
解决方案 »
- SSTAB动态添加控件总是创建到第一页...在线等
- 用GetAsyncKeyState实现隐藏与重现的问题
- 大虾你好,vba如何操作word
- winsock控件的状态8,也就是sckClosing,帮助文件说是同级人员正在关闭,如何避免?
- [求助]有关远程数据库访问的问题
- 请教一个关于xml的问题,有分酬谢,这里253了。
- 求一些关键地方的代码!
- data report设计报表大小,方向的问题。急!
- 高分! 但是不知道是不是简单。。。 关于Excel中焦点的问题。发言有分!
- VB中引用ADODC部分功能有问题
- 關於多個進程之間的調用?請有關人士幫助,如果數分不夠可再加
- 关于使用SOCKS5代理服务器的问题,说难不难,说易不易
" where datepart(yyyy,pur_date)>= " & strYear1 & " and datepart(yyyy,pur_date)<= " & strYear2 & _
" and datepart(mm,pur_date)>= " & strMon1 & " and datepart(mm,pur_date)<= " & strMon2 & _
" order by dept_dsc ", gcnGDmis注意引号之间的空格,因为你要组成可执行的SQL字符串!