where to_char(ddate,'yyyymmdd')='20030117'

解决方案 »

  1.   

    java.util.Date d  = new java.util.Date();
             SimpleDateFormat fm= new SimpleDateFormat("yyyy-MM-dd"); //the date format
             String strDate=fm.format(d);
    日期后面的就不用管了只要取出当天的就可以了
      

  2.   

    既然是一整天(00:00到23:59),为何不用
    where to_date("starttime拼成的yyyy-mm-dd 的字符串","yyyy-mm-dd")<ddate and ddate<("enttime拼成的yyyy-mm-dd 的字符串","yyyy-mm-dd")
    当然也可以用
    where to_date("starttime拼成的yyyy-mm-dd H24:MM的字符串","yyyy-mm-dd H24:MM")>ddate and ddate<("enttime拼成的yyyy-mm-dd H24:MM的字符串","yyyy-mm-dd H24:MM")注:yyyy-mm-dd H24:MM,你得查一下是否写得对,因为我记不清楚了。