dim today as string
dim ago as integer
dim agoday as string
ago=3
today=format(now,"yyyy-mm-dd")
agoday=format(cdate(cdbl(now)-ago),"yyyy-mm-dd")
select * from tb where news_date between #"& agoday &# and #"&today &"#
dim ago as integer
dim agoday as string
ago=3
today=format(now,"yyyy-mm-dd")
agoday=format(cdate(cdbl(now)-ago),"yyyy-mm-dd")
select * from tb where news_date between #"& agoday &# and #"&today &"#
如果要,就是
select * from table where int(now)-int(News_date)<=3
如果不要,就是
select * from table where int(now)-int(News_date)<3基本原理是:在ACCESS数据库,所谓日期型,其实是一个DOUBLE型
数据。以上SQL语句可以直接在ACCESS2000中通过。