|
With sumRec1 as (
select empID1, code1, sum(quantity) as tot1
from rec1 where recDate Between
070701 and 080410
group by empID1, code1
order by empID1,code1
),
SumRec2 as(
select empID2, code2, sum(quantity) as tot2
from rec2
group by empID2, code2
order by empID2,code2
)
select empid1, code1, tot1, tot2
from sumRec1 left outer join sumRec2 on empid1=empid2 and code1=code2
where tot1<>tot2
<untested>
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.