Office中国论坛/Access中国论坛

标题: 为什么以下语句无法实现查询的功能,老提示运行时错误‘3065’,请大侠支招,谢谢! [打印本页]

作者: dreamice01    时间: 2008-1-28 09:34
标题: 为什么以下语句无法实现查询的功能,老提示运行时错误‘3065’,请大侠支招,谢谢!
dbs.Execute "select contract_number,sale_department,nation,operation,product_sort,期初收入,期初成本,kaohe_term,contract_number_equipment,remark from 待匹配数据整理表按合同号加总 where kaohe_term=' #distr_rate_term# '"

kaohe_term为日期型字段
作者: dreamice01    时间: 2008-1-28 10:20
不行,还是提示错误:

运行时错误“3075”
日期的语法错误,在查询表达式'kaohe_term= #distr_rate_term# '中
作者: dreamice01    时间: 2008-1-28 10:30
还是不行,提示“参数不足,期待是1”
我把语句改为:[kaohe_term]= [distr_rate_term]或
[kaohe_term]= [#distr_rate_term#]
都是同样的错误提示
作者: haemon    时间: 2008-1-28 12:10
得这样写:
where kaohe_term=" #" &distr_rate_term &"#"
作者: dreamice01    时间: 2008-1-29 08:32
感谢,非常感谢!!!!




欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/) Powered by Discuz! X3.3