sql语句,关于时间
在asp中,其中sysid和syjie是数字型的, sysj是日期型的。我是 这么写的?
sql= "select * from confirmsys where sysid= "&sysid& " and syjie= "&j& " and sysj= "&date()+i
执行后达不到预期结果,关键是时间的那个条件对吗?
------解决方案--------------------access数据库中的有关日期的sql要加 #
------解决方案--------------------呵呵
SQL的 '
ACCESS的#
------解决方案--------------------sql
sql= "select * from confirmsys where sysid= "&sysid& " and syjie= "&j& " and datadiff( 'd ',sysj,getdate())= "&i& " "
access
sql= "select * from confirmsys where sysid= "&sysid& " and syjie= "&j& " and datadiff( 'd ',sysj,now())= "&i& " "