1. SQL Server 2000 time must be enclosed by single quotation marks''
Strsql. Format (_ T ("select * from info where warehouse receiving time "));
Strsql + = begindate. Format (_ T ("'% Y-% m-% d "); // SQL Server time needs to be enclosed by simple comment'', while access needs to be included ##
Strsql + = begintime. Format (_ T ("% H: % m: % s'"));
Strsql + = _ T ("and ");
Strsql + = enddate. Format (_ T ("'% Y-% m-% d "));
Strsql + = endtime. Format (_ T ("% H: % m: % s'"));
Strsql + = _ T ("order by warehouse receiving time ASC ");
2. The time in access must be included by a pair of well numbers ##
Str. Format (_ T ("select * from node information where time "));
STR + = begindate. Format (_ T ("#% Y-% m-% d "));
STR + = begintime. Format (_ T ("% H: % m: % s#"));
STR + = _ T ("and ");
STR + = enddate. Format (_ T ("#% Y-% m-% d "));
STR + = endtime. Format (_ T ("% H: % m: % s#"));
STR + = _ T ("order by time ASC ");