关于ACCESS联合查询(SQL语句)问题
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获得月份,即查询条件为工单表中某年某月的所有客户表中的资料
问题点数:30、回复次数:6Top
1 楼northwolves(狼行天下)回复于 2003-12-02 22:46:10 得分 30
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)
Top
2 楼Neoking(尼奥)回复于 2003-12-02 22:51:54 得分 0
请解释一下好吗?? 17931client.* 这是什么意思!!!?Top
3 楼berylw(漏洞)回复于 2003-12-02 22:56:35 得分 0
17931client是一个表的名字,
.*是17931client表的全部字段名Top
4 楼berylw(漏洞)回复于 2003-12-02 22:59:34 得分 0
TO: northwolves(野性的呼唤)
用了你的语句还是提示"from字句语法错误"Top
5 楼jizehao(zehao)回复于 2003-12-02 23:29:16 得分 0
upTop
6 楼northwolves(狼行天下)回复于 2003-12-02 23:32:33 得分 0
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)&"#"Top




