asp 中数据库的查询

来源:百度知道 编辑:UC知道 时间:2024/04/26 06:18:49
如何查询一段时间 在数据库中 日期的列名是UPDATEdate
sql= "select * from WebPlayer where UpdateDate > '"&d_ext1&"' and UpdateDate < '"&d_text2&"'"
提示数据类型不匹配
d_text1和D_TEXT2分别是填写日期的

sql= "select * from WebPlayer where UpdateDate > #"&d_text1&"# and UpdateDate < #"&d_text2&"#

如果是使用access数据库,查询日期类型的字段时,使用“#”MSSQL里是使用“'”的。hlzgw的回答,最后好像漏了个双引号,呵呵