如何正确执行查询日期?
sgap 2003-04-06 10:20:06 我使用VB+ACCESS数据库,其中使用ADO连接时,发现日期查询无结果,请各位高手帮忙:
表名为tblDepaCM,出港日期在表中定义为短时间型
exit_date=formatdatetime(text1.text,vbShortDate)
str_sql = "select * from tblDepaCM" _
where 出港日期 between " & "#" & exit_date & "# and #03-3-20#"
adoPrimaryRS.CursorLocation = adUseClient
adoPrimaryRS.Open str_sql, db, adOpenDynamic, adLockOptimistic
Debug.Print adoPrimaryRS.RecordCount
可以运行,但结果不正确,无记录。
请大虾给予解决,谢谢!