输入时间格式2004-06-01.输入两个时间
记录时间的字段case_date也是这个格式。

解决方案 »

  1.   

    首先,用下面函数把日期转换长2004-06-01格式<%Rem 改变日期为长进制
    function datetod(str)
    if isnull(str) then
    checkStr = ""
    exit function 
    end if
    dateyear =year(str)
    datemonth =month(str)
    dateday =day(str)
    if len(datemonth)=1 then
       datemonth="0"&datemonth
    end if
    if len(dateday)=1 then
       dateday="0"&dateday
    end if
    datetod=dateyear&"-"&datemonth&"-"&dateday
    end function
    %>
    其次:select * from jqhkbz where   startdate<='"& Datetod(datekey)&"' and  enddate>'"& Datetod(datekey)&"'
      

  2.   

    分别取到二个时间的值记为如$date1,$date2,然后写查询语句
    如$sql = "select * from case where case_date>='$date1' and case_date<='$date2'";
      

  3.   

    这种取两个时间当中的查询,最好是使用UNIX时间戳的方式.
    用别的方法都太麻烦....
      

  4.   

    先要确定你的case_date是什么字段。然后才好查询。
      

  5.   

    参照这个
    http://community.csdn.net/Expert/topic/3025/3025781.xml?temp=8.205813E-02
      

  6.   

    select * from case where case_date BETWEEN '$start_date' AND '$end_date'