可动态写 connectionstring  当前路径用 GetCurrentDir 可获得
    日期判断似乎应该用这种模式  #mm/dd/yyyy#

解决方案 »

  1.   

    select * from table1 where outday between datevalue(edit1.text) and datevalue(edit2.text);
      

  2.   

    1、ExtractFilePath(Application->ExeName) 即可得到当前路径。
    2、AnsiString sql="select * from table1 where outday between :val1 and :val2";
       Query1->SQL->Add(sql);
       Query1->ParamByName("val1")->AsString=edit1.text;
       Query1->ParamByName("val2")->AsString=edit2.text;
       Query1->Open();
      

  3.   

    1.当前路径可通过API函数获得。
    2.首先你应该将edit1.text、 edit1.text 转换成'2001-01-01'格式(使用Format 函数) 然后比较。SQLStr := 'select * from table1 where outday between ''s1'' and ''s2''';