Ok then you can play with the following ones then you know what to do to remove the vendor filter:
**** All paid vouchers for each vendor record as per the specified Apply Date range
Select APTVCHNM, APTODCNM,
sum(TEN99AMNT) as TEN99Total,
sum(APFRMAPLYAMT) as AppliedTotal
from PM30300 where VENDORID = 'XXX'
and DATE1 between '2010-01-01' and '2010-12-31'
group by VENDORID, APTVCHNM, APTODCNM
**** All paid vouchers that have total applied amounts that are not equal to their total 1099 amounts for the specified Apply Date range.
Select (b.AppliedTotal - b.TEN99Total) as DIFF, * from
(select VENDORID, APTVCHNM, APTODCNM,
sum(APFRMAPLYAMT) as AppliedTotal,
sum(TEN99AMNT) as TEN99Total
from PM30300 where VENDORID = 'XXX'
and DATE1 between '2010-01-01' and '2010-12-31'
group by VENDORID, APTVCHNM, APTODCNM) b
where b.TEN99Total <> b.AppliedTotal
**** Total difference between applied amount and 1099 for each vendor.
Select sum(DIFF) as TotalDIFF from
(select (b.AppliedTotal - b.TEN99Total) as DIFF, * from
(select VENDORID, APTVCHNM, APTODCNM,
sum(APFRMAPLYAMT) as AppliedTotal,
sum(TEN99AMNT) as TEN99Total
from PM30300 where VENDORID = 'XXX'
and DATE1 between '2010-01-01' and '2010-12-31'
group by VENDORID, APTVCHNM, APTODCNM) b
where b.TEN99Total <> b.AppliedTotal) a
If the PM00204 table is damaged, the 1099 amounts may not reconcile with the actual transaction data