回 帖 发 新 帖 刷新版面

主题:where 字段名 between and

where 字段名 between '2006-12-12' and  'date()'
如何让查询结果包含date()这天的信息啊

回复列表 (共4个回复)

沙发

sql="select * from table where 字段名 between #2006-12-12# and  #"&date()&"#"

板凳

我以前都是这样写的,但他不包含今天的date(),在说sql里可以用#吗?我记得好想是accese里用# sql里这可以用'

3 楼

sql="select * from table where 字段名 > #2006-12-12# and  字段名<=#"&date()&"#"
可以用#号

4 楼

date是指当天的零时,如果要包含这个日期,要拼凑程 date() + ' 23:59:59'
最简单的方法是直接用date()+1

我来回复

您尚未登录,请登录后再回复。点此登录或注册