我试了好多方法都不行。不知道为什么!
我用的是ACCESS+ADO数据库,字段名date,是日期/时间类型。在ACCESS中设计的输入掩码是0000-99-99;0;_(不知道这有没有关系)。多谢各位大侠!
我用的是ACCESS+ADO数据库,字段名date,是日期/时间类型。在ACCESS中设计的输入掩码是0000-99-99;0;_(不知道这有没有关系)。多谢各位大侠!
from table1
where date>=#2004-06-01# and date<#2004-07-01#这样的字段名date容易和系统冲突~~
date2:=daysbetween(DateTimePicker2.Date,date());
if DateTimePicker1.Date<date() then date1str:='-'+inttostr(date1) else date1str:='+'+inttostr(date1);
if DateTimePicker1.Date<date() then date1str:='-'+inttostr(date2) else date2str:='+'+inttostr(date2); if (querysql='') then querysql:='where '+'ymd >=date()'+date1str+' and '+'ymd <=date()'+date2str
else querysql:='and '+'ymd >=date()'+date1str+' and '+'ymd <=date()'+date2str
end;