例如:有个表:table1 字段:date1
我要查询:
   date1>2003-4-21
   date1<2003-5-21
这怎么实现?谢谢

解决方案 »

  1.   

    "select * From Table1 where  date1>'" & BeginDate.Value & "'and date1<'" & EndDate.Value & "' "
      

  2.   

    select * from table1 where date1 between #2003-4-21# and #2003-5-21#
      

  3.   

    '数据库为access:
      strsql="select * from table1 where date1 between # 2003-4-21 # and # 2003-5-21 # "
    '数据为为sql:
      strsql="select * from table1 where date1 between '2003-4-21' and '2003-5-21'"
      

  4.   


     strsql="select * from table1 where date1 between #4-21-2003# and #5-21-2003#"请注意年,月日的顺序,在SQL诘句中要按照这样的顺序写,要不然要出错,在SQL中,#号是用于时间格式的, '' 号是用于字符串格式的.
      

  5.   

    请楼上几位,你们的SQL语句测试过没有?如果能通过测试的话,我每人给你们一百分!