select * from tablename
where bdate<='2004-8-1' and edate>='2004-8-1'

解决方案 »

  1.   

    select * 
    from tablename
    where bdate='2004-8-1' and edate='2004-8-1'
      

  2.   

    TO:redjoker(deathknight) 
    你说的办法不行的,因为bdate与edate是日期时间型字段,不是文本型字段,其实我的写法在SQL SERVER上面是可以通过的,
    但是转成ACCESS数据库就不行了,
      

  3.   

    我知道,因为我用select d from table1 where d<=1980-5-5 and d>=1800-5-5 
    这样的语句测试过,在SQL SERVER上没有通过.查出来没有记录集.改成d<='1980-5-5' and d>='1800-5-5'就行了. 我也搞不清楚是为什么.按道理讲是没有问题的.不知道是不是版本问题.我ACCESS中也按你的写法我没有通过.
      

  4.   

    Access:select * 
    from tablename
    where bdate=#2004-8-1# and edate=#2004-8-1#