老大们,帮帮忙!!sql问题,50分,解决就给!
我想从5张表里提数据,每张表字段相同,其中有一字段为开户日期kaihui_date,类型string,现在我要写一条sql语句,根据两个datetimepicker设立的时间段,将五张表中属于这段时间的记录提出来,怎样写?
with query2 do begin
close;
with sql do begin
clear;
if (checkbox1.state=cbchecked)or (checkbox2.state=cbchecked) then
begin
add('select * from jiben_account,yiban_account,temp_account,zuanyong_account,qita_account');
//add('select * from yiban_account');
//add('select * from temp_account');
// add('select * from zuanyong_account');
// add('select * from qita_account');
// add('number<>''''');
add('where strtodate(kaihui_date)<=t2.date and strtodate(kaihui_date)>=t1.date') ;
end;
end;
open;
query2.first;
为什么会报错??