G
Gingerzy
Unregistered / Unconfirmed
GUEST, unregistred user!
1:
s_dtToday := '#' + Formatdatetime('YYYY-M-D',Now) + '#';
with AdoQuery1 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT ');
Sql.Add('B.Cstm_Name ');
Sql.Add('FROM T_RemindData A ');
Sql.Add(' LEFT JOIN T_Order B ON A.Oder_ID=B.Oder_ID ');
Sql.Add(' WHERE LEFT(A.Rmdt_Date,10) = '+s_dtToday);
Open;
end;
2:
with AdoQuery1 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT ');
Sql.Add('B.Cstm_Name ');
Sql.Add('FROM T_RemindData A ');
Sql.Add(' LEFT JOIN T_Order B ON A.Oder_ID=B.Oder_ID ');
Sql.Add(' WHERE LEFT(A.Rmdt_Date,10) = :rmdtDate ');
Parameters.ParamByName('rmdtDate').Value := '#' + Formatdatetime('YYYY-M-D',Now) + '#';
Open;
end;
为什么1可以得到结果2却不行呢,delphi6+access 谢谢!
s_dtToday := '#' + Formatdatetime('YYYY-M-D',Now) + '#';
with AdoQuery1 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT ');
Sql.Add('B.Cstm_Name ');
Sql.Add('FROM T_RemindData A ');
Sql.Add(' LEFT JOIN T_Order B ON A.Oder_ID=B.Oder_ID ');
Sql.Add(' WHERE LEFT(A.Rmdt_Date,10) = '+s_dtToday);
Open;
end;
2:
with AdoQuery1 do
begin
Close;
Sql.Clear;
Sql.Add('SELECT ');
Sql.Add('B.Cstm_Name ');
Sql.Add('FROM T_RemindData A ');
Sql.Add(' LEFT JOIN T_Order B ON A.Oder_ID=B.Oder_ID ');
Sql.Add(' WHERE LEFT(A.Rmdt_Date,10) = :rmdtDate ');
Parameters.ParamByName('rmdtDate').Value := '#' + Formatdatetime('YYYY-M-D',Now) + '#';
Open;
end;
为什么1可以得到结果2却不行呢,delphi6+access 谢谢!