access数据库中,表table1的一字段date1用字符类型来存储时间,现要从table1中取出date1在1949-01-01和2000-01-02中的记录,请问sql语句要怎样写?

解决方案 »

  1.   

    select * from table where date>'19490101' and date<'20000102'
      

  2.   

    select * from table where cast(date1 as date) between '1949-01-01' and '2000-01-02'
      

  3.   

    select * from yourtable where date1>=#1949-01-01# and  date2<=#2000-01-02#
      

  4.   

    select * from table where date1 between '1949-01-01' and '2000-01-02'
      

  5.   

    function CompareDate(const A, B: TDateTime): TValueRelationship;//比较日期的函数给你了
      

  6.   

    你通过字符串截取函数copy()函数把日期型数据的'_   _   _' 去掉再保存到一个字符变量中,两个字符变量之间比较就OK!!!
    我碰到过和你一样的问题,肯定能帮你解决,要是你还不知道,请与我联系,我有代码!!!
      

  7.   

    select * from table where date1 between '1949-01-01' and '2000-01-02'