ASP关于时间调用的问题
select*from[FIEFD]whereyear(date)=year(now)andmonth(date)=month(now)andday(date)=day(...
select * from [FIEFD] where year(date) = year(now) and month(date) = month(now) and day(date) = day(now)-1 and time(date)>'13:30:00' order by id desc"
想要调用数据库中前一天13点30分以后的资料,写法上有点错误,请指点 展开
想要调用数据库中前一天13点30分以后的资料,写法上有点错误,请指点 展开
2个回答
展开全部
时间的字段名称是否是date?
应该用datediff函数,另外字段名称不要用date,因为date为数据库保留字段,如果一定要用,字段要加中括号:
SQL数据库:select * from [FIEFD] where (datediff(d,[date],'"&date()&"')=1 and hour([date])>13 and minute([date])>30)
如果是Access数据库:select * from [FIEFD] where (datediff('d',[date],date())=1 and hour([date])>13 and minute([date])>30)
应该用datediff函数,另外字段名称不要用date,因为date为数据库保留字段,如果一定要用,字段要加中括号:
SQL数据库:select * from [FIEFD] where (datediff(d,[date],'"&date()&"')=1 and hour([date])>13 and minute([date])>30)
如果是Access数据库:select * from [FIEFD] where (datediff('d',[date],date())=1 and hour([date])>13 and minute([date])>30)
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询