VBA in SQL -- finding near duplicities

M

Matej Cepl

Hi,

I am somehow experienced working with databases (mainly PostgreSQL on
Linux) and with scripting (bash, Python, Basic), but total newbie when
it comes to Access. However, in this temp job I need to find
duplicities in 120,000 records table and Access comes handy. I found in
this newsgroup some VBA functions for find near similarities in VBA
(http://groups.google.com/group/comp.databases.ms-access/msg/345092c980746e13),
but now I have hard time to integrate this function into SQL Query
created by Find Duplicates wizard.

This is what I've got from the wizard:

SELECT title, address1, address2, city, state, company, FirstName,
LastName,
zipcode, country, telephone, fax, [E-mail/URL], Source
FROM allThreeCombined
WHERE (((allThreeCombined.title) In
(SELECT [title] FROM [allThreeCombined] As Tmp GROUP BY
[title],[address1],[address2],[city],[state],[company]
HAVING Count(*)>1
And
[address1] = [allThreeCombined].[address1]
And
[address2] = [allThreeCombined].[address2]
And
[city] = [allThreeCombined].[city]
And
[state] = [allThreeCombined].[state]
And
[company] = [allThreeCombined].[company])))
ORDER BY title, address1, address2, city, state, company;

and followinig (as much as I can) advice of
http://office.microsoft.com/en-us/assistance/HA010345581033.aspx I have
created this:

SELECT title, address1, address2, city, state, company, FirstName,
LastName, zipcode, country, telephone, fax, [E-mail/URL], Source
FROM bigTesting
WHERE (((bigTesting.title) In
(SELECT [title] FROM [bigTesting] As Tmp
GROUP BY [title],[address1],[address2],[city],[state],[company]
HAVING Count(*)>1
And SimilCmp([address1],[bigTesting].[address1]) = 1
And SimilCmp([address2],[bigTesting].[address2]) = 1
And SimilCmp([city],[bigTesting].[city]) = 1
And SimilCmp([state],[bigTesting].[state]) = 1
And SimilCmp([company],[bigTesting].[company]) = 1
)
))
ORDER BY title, address1, address2, city, state, company;

However, Access doesn't seem to like it (compile error). Any idea, what
I am doing wrong?

Thanks for any hint,

Matej
 

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