adate="2008-01-02" '查询日期条件'---------------ayear=year(adate)'单独取出年2008amonth=month(adate)'单独取出月01aday=date(adate)'单独取出日02sql="select * from 表名 where year(时间)='"&ayear&"' and month(时间)='"&amonth&"' and year(时间)='"&aday&"'"因为你数据库里的日期是长日期型,如:你的日期条件是这样:2008-01-02//可数据库里是这样:2008-01-02 15:59:42 这样就不可以查了,sql应该可以这样写也对 用 likeadate="2008-01-02" '查询日期条件sqlserver句法:sql="select * from 表名 where 时间 like '%"&adate&"%'"access句法:sql="select * from 表名 where 时间 like #%"&adate&"%#"就是指像今天的吗?昨天不是也查不出来吗,