S sun_flower_2000 Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-13 #1 str_sql:=str_sql+'and (EXPIREDATE>'+DateTimePicker1.datetime;报错类型不匹配 请问如何动态拼写关于时间的检索语句?
J jackchin Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-13 #2 Query.SQL.Text := 'select * from Table where EXPIREDATE > :EXPIREDATE'; Query.Params[0].AsDateTime := DateTimePicker1.datetime; Query.Active := True;
Query.SQL.Text := 'select * from Table where EXPIREDATE > :EXPIREDATE'; Query.Params[0].AsDateTime := DateTimePicker1.datetime; Query.Active := True;
W WoDing Unregistered / Unconfirmed GUEST, unregistred user! 2004-01-13 #4 如果是ACCESS str_sql:=str_sql+'and (EXPIREDATE>#'+formatdatetime('yyyy-mm-dd hh::mm::ss',DateTimePicker1.datetime)+'#'; 如果是SQL server str_sql:=str_sql+'and (EXPIREDATE>'+formatdatetime('yyyy-mm-dd hh::mm::ss',DateTimePicker1.datetime);
如果是ACCESS str_sql:=str_sql+'and (EXPIREDATE>#'+formatdatetime('yyyy-mm-dd hh::mm::ss',DateTimePicker1.datetime)+'#'; 如果是SQL server str_sql:=str_sql+'and (EXPIREDATE>'+formatdatetime('yyyy-mm-dd hh::mm::ss',DateTimePicker1.datetime);