请教ASP查询日期字段的SQL语句?
查询Product 表中enddate日期小于当前日期
sql= "select * from Product where enddate < "&cdate(date())
我这么写为什么总是不对呀!应该怎么写才对呀,谢谢!
------解决方案--------------------sql= "select * from Product where datediff(s,enddate, ' "&cdate(date())& " ')> 0 "
------解决方案--------------------sql= "select * from Product where enddate <# "&cdate(date())& "# "
你这样试试
------解决方案--------------------Access:
sql= "select * from Product where enddate <# "&cdate(now())& "# "
SQL:
sql= "select * from Product where enddate < ' "&cdate(now())& " ' "
------解决方案--------------------access:
sql= "select * from Product where enddate <# "&cdate(date())& "# "
sql:
sql= "select * from Product where enddate < ' "&cdate(date())& " ' "