View Full Version : query or sql?


jenny_gurl
11-11-2005, 07:50 AM
Hello,

I wonder if i'm posting inthe right forum, but this is driving me mad!
I'm in the process of building a database whereby i can check whether there is any duplication of items. I have a form that lists the tables in the database and the the fields corresponding to the selected table. what i need to do is basically replicate the access built-in "find duplicates query", which basically checks if values in one field are repeated, then those records are displayed.

Also I need to create the query in such a way that it not only searches for exact duplicates, but also for runs a string search. i.e. if an item say ABC appears as ABCD, it must also be picked up.

Since the tables and the field in which the duplicate occurs are both user defined and constantly changing, i cant really make queries and store them. I would like to use SQL to achieve this but am not sure how to do this? My list boxes are called listtable and listfield and i would like their values to be referenced in the SQL statement instead of actual table names.

Can anyone help me with the code on this?

Pat Hartman
11-13-2005, 07:27 PM
Since the tables and the field in which the duplicate occurs are both user defined and constantly changing users should not be modifying or creating tables in a shared database. This is a recipe for disaster. Since they are allowed to create their own objects, teach them how to use the find duplicates query builder and teach them how to use the find dialog.