A
afei_20010929
Unregistered / Unconfirmed
GUEST, unregistred user!
代码:
picker1,picker2:string;
begin
with ZTQuery do
begin
// DateSeparator := '/'; ShortDateFormat:='yy/mm/dd';
// picker1:=Formatdatetime('yy/mm/dd',DateTimePicker1.DateTime);
// picker2:=Formatdatetime('yy/mm/dd',DateTimePicker2.DateTime);
picker1:=datetimetostr(DateTimePicker1.Date);
picker2:=datetimetostr(DateTimePicker2.Date);
ZTQuery.SQL.Text:='select czrq from ZT where (czrq>='+''''+picker1+''''
+') and (czrq<='+''''+picker2+''''+')';
// ZTQuery.SQL.Text:='select czrq from ZT where zt.czrq between :"'+picker1+'" and :"'+picker2+'"';
ZTQuery.ExecSQL;
end;
end;
这个程序用的是一本地库,库里这个字段是@(timestamp)型,库内纪录我用的是SQL insertrecrod 语句插入的,有时分秒.我现在用两个
DateTimepicker来查询一段时间内的纪录,只要从哪一天到哪一天,不要时分秒.我用了上面的方法不是运行程序后报错就是查的纪录不
对,请教各位这个语句我应该怎么写.