I apologize to you pros for what must be an amateur question. I have a table with records that have been closed, (complete = 1)and nearly duplicate records that need to be closed (complete = 0)or deleted. They will have the same purchase order number, line, and release.
Here is my query, which returns multiple records where there should be only one for each key#. I know I'm doing something wrong with the join, but can't see what.
Thanks in advance for any help.
Here's the query, I've changed the field names to protect you from the harsh realities of our naming conventions.
select
r1.Recordtype,
r1.complete,
r1.Key#,
r1.POnum,
r1.POline,
r1.POrelease,
r1.received,
r1.accepted,
r1.rejected,
r1.hold
from Receipts r1
inner join Receipts r2
on (r1.POnum = r2.POnum
and r1.POline = r2.POline
and r1.POrelease = r2.POrelease)
WHERE (r1.complete = 0 AND r1.Recordtype = 'P')
order by r1.Key#
MANY THANKS!
The world is full of good people.
Here is my query, which returns multiple records where there should be only one for each key#. I know I'm doing something wrong with the join, but can't see what.
Thanks in advance for any help.
Here's the query, I've changed the field names to protect you from the harsh realities of our naming conventions.
select
r1.Recordtype,
r1.complete,
r1.Key#,
r1.POnum,
r1.POline,
r1.POrelease,
r1.received,
r1.accepted,
r1.rejected,
r1.hold
from Receipts r1
inner join Receipts r2
on (r1.POnum = r2.POnum
and r1.POline = r2.POline
and r1.POrelease = r2.POrelease)
WHERE (r1.complete = 0 AND r1.Recordtype = 'P')
order by r1.Key#
MANY THANKS!
The world is full of good people.