mgraulich
Ten Centuries
Points: 1294
More actions
October 11, 2005 at 8:12 am
#166245
I have two tables. One table with header information and one with detail. On the header record, there is sum total that should match the sum of the detail records. I need to write a query to make sure those totals match on separate tables. Thanks!
mimorr
SSCarpal Tunnel
Points: 4850
October 11, 2005 at 8:28 am
#596544
select hdr.unqkey, sum(dtl.amt), hdr.hdr_amt_field
from hdr join dtl on
hdr.unqkey = dtl.unqkey
group by hdr.unqkey, hdr.hdr_amt_field
having sum(dtl.amt) hdr_amt_field
Michelle
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply