L
liuxiaouo
Unregistered / Unconfirmed
GUEST, unregistred user!
ADOQuery1.Close;
ADOQuery1.SQL.add('select top 50 * from otherouth where notedate>="'+formatdatetime('mm/dd/yyyy 00:00:00',datetime1)+'"');
ADOQuery1.SQL.add('and notedate<="'+formatdatetime('mm/dd/yyyy 23:59:59',Datetime2)+'"');
showmessage(ADOQuery1.SQL.Text);
ADOQuery1.Open;
注:Datetime,Datetime2:Tdatetime;
datetime1:=DateTimePicker1.DateTime;
datetime2:=DateTimePicker2.DateTime;
假设DateTimePicker1.DateTime为:10/02/2000;
DateTimePicker2.DateTime为:02/01/2001;
出现的错误提示为:
‘invalid column name’ 10/02/2000 00:00:00”
ADOQuery1.SQL.add('select top 50 * from otherouth where notedate>="'+formatdatetime('mm/dd/yyyy 00:00:00',datetime1)+'"');
ADOQuery1.SQL.add('and notedate<="'+formatdatetime('mm/dd/yyyy 23:59:59',Datetime2)+'"');
showmessage(ADOQuery1.SQL.Text);
ADOQuery1.Open;
注:Datetime,Datetime2:Tdatetime;
datetime1:=DateTimePicker1.DateTime;
datetime2:=DateTimePicker2.DateTime;
假设DateTimePicker1.DateTime为:10/02/2000;
DateTimePicker2.DateTime为:02/01/2001;
出现的错误提示为:
‘invalid column name’ 10/02/2000 00:00:00”