Duplicate query

G

Guest

Dear All, please help me.

I have table with field name Tape, Date of payment, Payment of code, Amount
and Transactions. Some of the data are duplicate for all of criteria. But I
just want to query data that only duplicate for Date of payment, Payment of
code, Amount and Transactions. I don't want the query shows the duplicate of
Tape.

Please help me.

Thanks
 
T

Tom Ellison

Dear RazMan:

How about this:

SELECT
[Date of payment],
[Payment of code],
Amount,
Transactions,
COUNT(*) AS DuplicateCount
From [Your Table Name Goes Here]
GROUP BY
[Date of payment],
[Payment of code],
Amount,
Transactions
ORDER BY
[Date of payment],
[Payment of code],
Amount,
Transactions
HAVING COUNT(*) > 1

This will show the values of the 4 columns that repeat, and the number of
times they repeat.

Tom Ellison
 
G

Guest

Dear Tom Ellison,

Thanks for gave your suggestion. The things work but could you tell me the
way that not count of duplicate. I still want to see the data so, I can
delete whatever duplicate data of 'Date of payment, payment of code, amount
and transaction' in different of 'Tape'.

Thank you so much.

Tom Ellison said:
Dear RazMan:

How about this:

SELECT
[Date of payment],
[Payment of code],
Amount,
Transactions,
COUNT(*) AS DuplicateCount
From [Your Table Name Goes Here]
GROUP BY
[Date of payment],
[Payment of code],
Amount,
Transactions
ORDER BY
[Date of payment],
[Payment of code],
Amount,
Transactions
HAVING COUNT(*) > 1

This will show the values of the 4 columns that repeat, and the number of
times they repeat.

Tom Ellison


Razman said:
Dear All, please help me.

I have table with field name Tape, Date of payment, Payment of code,
Amount
and Transactions. Some of the data are duplicate for all of criteria. But
I
just want to query data that only duplicate for Date of payment, Payment
of
code, Amount and Transactions. I don't want the query shows the duplicate
of
Tape.

Please help me.

Thanks
 
T

Tom Ellison

Dear Razman:

I'm sorry, but I do not understand what it is you now want.

If you wish to see the whole records containing these duplicates, you should
save the query I gave before as QryDups and try this:

SELECT T.*
FROM [Your Table Name Goes Here] T
INNER JOIN QryDups Q
ON Q.[Date of payment] = T.[Date of payment]
AND Q.[Payment of code] = T.[Payment of code]
AND Q.Amount = T.Amount
AND Q.Transactions = T.Transactions

Tom Ellison


Razman said:
Dear Tom Ellison,

Thanks for gave your suggestion. The things work but could you tell me the
way that not count of duplicate. I still want to see the data so, I can
delete whatever duplicate data of 'Date of payment, payment of code,
amount
and transaction' in different of 'Tape'.

Thank you so much.

Tom Ellison said:
Dear RazMan:

How about this:

SELECT
[Date of payment],
[Payment of code],
Amount,
Transactions,
COUNT(*) AS DuplicateCount
From [Your Table Name Goes Here]
GROUP BY
[Date of payment],
[Payment of code],
Amount,
Transactions
ORDER BY
[Date of payment],
[Payment of code],
Amount,
Transactions
HAVING COUNT(*) > 1

This will show the values of the 4 columns that repeat, and the number of
times they repeat.

Tom Ellison


Razman said:
Dear All, please help me.

I have table with field name Tape, Date of payment, Payment of code,
Amount
and Transactions. Some of the data are duplicate for all of criteria.
But
I
just want to query data that only duplicate for Date of payment,
Payment
of
code, Amount and Transactions. I don't want the query shows the
duplicate
of
Tape.

Please help me.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top