Delphi求解决 代码查询问题
begin
sql1 := 'select isnull(a.ks_name,b.ks_name) as q,isnull(a.TotalZhichu,0) as w,isnull(b.TotalShouru,0) as e from ';
sql1 :=sql1+'(select ks_name,sum(zhichujine) as TotalZhichu from yz_qyzc where 1>0' +s1+ 'group by ks_name) a full join(select ks_name,sum(fyje) as TotalShouru from yz_qysr where 1>0 '+s1+' group by ks_name) b on a.ks_name=b.ks_name ';
if RadioButton1.Checked = true then
begin
s1 := 'and fydate>= '+''''+datetostr(DateTimePicker1.Date)+'''' + 'and fydate<= '+''''+datetostr(DateTimePicker2.Date)+'''';
end;
s1这个字段执行不了,哪写的不对????