I actually posted the following question on another site (Access forum) but received no bites so I thought I'd ask here...
I've used the "Find Duplicates" wizard to find occurrences of records with the same date in the date field of my database (5000 records to sift through). These tend to be unnecessary entries which I will then manually delete.
What I would like to do now is modify this query to find dates RIGHT NEXT to each other.
Example:
* Previously, 12/25/06 and 12/25/06 showed up as duplicates.
* Now I'd like (12/24/06 and 12/25/06) and/or (12/25/06 and 12/26/06) to show up in this query together.
If the current syntax is this:
In (SELECT [cust_ID] FROM [Database] As Tmp GROUP BY [cust_ID],[Exp Date] HAVING Count(*)>1 And [Exp Date] = [Database].[Exp Date])
How do I modify it to find adjacent dates within each given customer's records?
Thanks.
-
-
SELECT [cust_ID] FROM [Database] As Tmp GROUP BY [cust_ID],[Exp Date] HAVING Count(*)>1 And [Exp Date] = [Database].[Exp Date] OR [Exp Date] = DATE_ADD([Database].[Exp Date],INTERVAL 1 DAY) OR [Exp Date] = DATE_SUB([Database].[Exp Date],INTERVAL 1 DAY)
Does that work? If not, what is the error?
MS Access 97 question:How do I modify "find duplicates" to find adjacent values?
Discussion in 'Windows OS and Software' started by A. Nonymous, May 10, 2007.