F
freesoft
Unregistered / Unconfirmed
GUEST, unregistred user!
sql语句我都写好了。
with dataf.ADOQuery3 do
begin
close;
sql.clear;
sql.add('select a.jpid,(a.jpdj+b.jpdj) as jpdj,a.* from jpxs as a ,jplb as c, (select jpid,sum(dj) as jpdj from tp group by jpid) as b ');
sql.add('where a.jpid= b.jpid');
sql.add('and a.jplb=c.jplb');
sql.add('union (select jpid,jpdj,jpxs.* from jpxs ,jplb where jpxs.jplb=jplb.jplb and jpxs.cprq>=''''+datetostr(bbf.datetimepicker1.date)+'''' and jpxs.jpid not in (select jpid from tp ))');
sql.add('order by a.jpid');
open;
现在要求在form上填加两个datetimepicker,要求union前的jpxs的sj,tp的sj介于两者之间。
union后的jpxs的sj, 也在这两者之间。我试过可是有问题。故请大家帮忙!
with dataf.ADOQuery3 do
begin
close;
sql.clear;
sql.add('select a.jpid,(a.jpdj+b.jpdj) as jpdj,a.* from jpxs as a ,jplb as c, (select jpid,sum(dj) as jpdj from tp group by jpid) as b ');
sql.add('where a.jpid= b.jpid');
sql.add('and a.jplb=c.jplb');
sql.add('union (select jpid,jpdj,jpxs.* from jpxs ,jplb where jpxs.jplb=jplb.jplb and jpxs.cprq>=''''+datetostr(bbf.datetimepicker1.date)+'''' and jpxs.jpid not in (select jpid from tp ))');
sql.add('order by a.jpid');
open;
现在要求在form上填加两个datetimepicker,要求union前的jpxs的sj,tp的sj介于两者之间。
union后的jpxs的sj, 也在这两者之间。我试过可是有问题。故请大家帮忙!