Procedure TForm1. FormShow (Sender: TObject);
Var date1: Tdatetime;
The begin
Date1:=now;
Edit1. Text:=datetostr (date1);
With ADOQuery1 do begin
The close;
SQL. The Clear;
SQL. The Add (' select * from JCQK ');
SQL. Add (' where end date & gt;='+ # 39 + formatdatetime (' DDDDD, date1) + # 39);
The Open;
If RecordCount> 0 then
Showmessage (' disciplinary personnel due! ');
end;
end;
Program is run when prompted standard expression data types do not match! Why is that?
CodePudding user response:
Formatdatetime (' DDDDD, date1) this is a date?CodePudding user response:
Format the time character set outside a QuotedStr ()SQL. Add (' where end date & gt;='+ QuotedStr (formatdatetime (' DDDDD, date1)));
CodePudding user response:
Format the time character set outside a QuotedStr ()SQL. Add (' where end date & gt;='+ QuotedStr (formatdatetime (' DDDDD, date1)));
To perform the above statements, the SQL query out as follows:
Select * from JCQK where end date & gt; (='2016-01-19' or type does not match! Error, unable to run!
The correct statement is: select * from JCQK where end date & gt;=2016-01-19
CodePudding user response:
Change your system date format as yyyy - - dd hh: MM MM: ssCodePudding user response:
Calculate wear parameter, just contact for the parameterTake a look at this: http://bbs.csdn.net/topics/391892191
CodePudding user response:
Access date had better use "#" number: # 2016-02-26 # or double quotes