strWhere:='Where LoginDate between '''+DateToStr(dtpStart.Date)
          +''' and '''+DateToStr(dtpEnd.Date)+'''';
sql server可以直接转换

解决方案 »

  1.   

    strWhere:='Where LoginDate between '''+DateToStr(dtpStart.Date)
              +''' and '''+DateToStr(dtpEnd.Date)+'''';
    是不是'''写错了
      

  2.   

    我用查询分析器,查得的结果是 2002-04-03,  在delphi测试时 label1.caption=datetostr(date);应该怎么处理
      

  3.   

    strWhere:='Where LoginDate between '+DateToStr(dtpStart.Date)
              +''' and '''+DateToStr(dtpEnd.Date)+'''';
      

  4.   

    strWhere:='Where LoginDate between '+DateToStr(dtpStart.Date)
              +''''+' and '+''''+DateToStr(dtpEnd.Date)+'''';