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 &"#

解决方案 »

  1.   

    select * from table where now - yourfield < 3
      

  2.   

    select * from table1 where DateDiff(DD, New_date, getdate()) <= 3
      

  3.   

    select * from table1 where DateDiff(DD, News_date, getdate()) <= 3
      

  4.   

    啊,这样还有小小问题。比如今天是20号,你究竟要不要17号的数据?
    如果要,就是
    select * from table  where int(now)-int(News_date)<=3
    如果不要,就是
    select * from table  where int(now)-int(News_date)<3基本原理是:在ACCESS数据库,所谓日期型,其实是一个DOUBLE型
    数据。以上SQL语句可以直接在ACCESS2000中通过。