男人说口罩啥意思:数据库是SQL server,在asp中如何显示一周内(七天内)的数据???
来源:百度文库 编辑:高考问答 时间:2024/05/03 22:50:06
数据库是SQL server,在asp中如何显示一周内(七天内)的数据???
数据库的时间字段为:dataandtime
请问具体的SQL语法因该怎么写????????
数据库的时间字段为:dataandtime
请问具体的SQL语法因该怎么写????????
SQL语句如下:
“字段...”是你要使用的表中的实际字段
主要是使用dateadd来限定时间范围的。
select 字段...
from 表
where dataandtime>dateadd(week,-1,getdate())
select * from 表 where dataandtime=weekday
if DateDiff("d",rs("dataandtime"),date())<7 then
看看行不行