Hi all, I have an access front end linking to a sql back end. I have an automated update query function that is working fine. Now I need to put a condition to this and having trouble where to begin. My first table consist of 3fields: a list of salestickets, a three digit code and an amount. This table is an weekly excel import. The salesticket needs to be unique but there are times when the excel sheet would have duplicate salesticket numbers with different three digit codes Ex. '56789 DRE' and '56789 CRE'. The users wants to import the ticket with the largest amount. I was thinking I could use an if statement but the problem is I would not know the largest amount at any given time. Ex. '56789 DRE 300' and '56789 CRE 400'. In this case; I would import the one with 400. This excel sheet can consist of more than 50000 rows so scrubing manually before the import is not an option especially since its automated. Some guidance please. Thank you