关于ACCESS联合查询(SQL语句)问题

berylw 2003-12-02 10:33:59
StrSql = "select 17931client.* from 17931client join 17931order on (17931client.cInstallPhone = 17931order.cInstallPhone) where 17931order.dDatetime >= #" & Trim(Combo2.Text) & "-" & Trim(Combo1.Text) & "-1# And 17931order.dDatetime <= #" & Trim(Combo2.Text) & "-" & Trim(Combo1.Text) & "-31#"

其中combo2.text获得年份,combo1.text获得月份,即查询条件为工单表中某年某月的所有客户表中的资料
...全文
110 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
northwolves 2003-12-02
  • 打赏
  • 举报
回复
try:
StrSql = "select 17931client.* from 17931client join 17931order on (17931client.cInstallPhone = 17931order.cInstallPhone) where 17931order.dDatetime >= #" & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 1) & "# And 17931order.dDatetime <= #" & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 31)&"#"
jizehao 2003-12-02
  • 打赏
  • 举报
回复
up
berylw 2003-12-02
  • 打赏
  • 举报
回复
TO: northwolves(野性的呼唤)

用了你的语句还是提示"from字句语法错误"
berylw 2003-12-02
  • 打赏
  • 举报
回复
17931client是一个表的名字,
.*是17931client表的全部字段名
Neoking 2003-12-02
  • 打赏
  • 举报
回复
请解释一下好吗?? 17931client.* 这是什么意思!!!?
northwolves 2003-12-02
  • 打赏
  • 举报
回复
try:
StrSql = "select 17931client.* from 17931client join 17931order on (17931client.cInstallPhone = 17931order.cInstallPhone) where 17931order.dDatetime >= " & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 1) & "And 17931order.dDatetime <= " & DateSerial(Trim(Combo2.Text), Trim(Combo1.Text), 31)

7,762

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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