Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Store Transaction Logs

Status
Not open for further replies.

mcgettge

IS-IT--Management
Nov 4, 2002
30
0
0
US
I need to delete duplicate transactions from a 3.5 million row table. The transactions appear with a different transaction number, but have the same store #, account #, transaction $ amount, transaction type, date, and are within 60 seconds of the original. I don't know where to go. I know that in Excel I could write multiple IF statements, but this data is well beyond the limits of Excel.
 
Provided [transaction number] is the PrimaryKey, you may try something like this (SQL code):
DELETE FROM tblTransactions
WHERE [transaction number] Not In (SELECT Min([transaction number]) FROM tblTransactions GROUP BY [store #], [account #], [transaction $ amount], [transaction type], Format([DateTime field],'yyyymmddhhnn'))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top