Minggu, 19 Oktober 2014

RE: [MS_AccessPros] Removing Duplicate entries

 

Thanks Graham,

That removes duplicates for delivery to the report but does not remove the duplicates from the table.

Is that a different routine?

Regards,

Robin

At 20/10/2014 10:10 AM, you wrote:

The angle-brackets are part of the space-holder in the example, so they should not be used in the actual SQL statement.  Either leave them out completely or, if your table name contains non-alphanumeric characters, use square brackets:

DELETE students.* FROM students
WHERE FieldD IN(SELECT MIN(FieldID) FROM students Group By [fieldid] Having Count(fieldID) > 1)

Best wishes,
Graham

 

From: MS_Access_Professionals@yahoogroups.com [ mailto:MS_Access_Professionals@yahoogroups.com]
Sent: Monday, 20 October 2014 11:52
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Removing Duplicate entries

 

 

I have a table with a few duplicate entries.

The Microsoft forum page says:

""" Make sure that your table has an autonumber field and it is set as the primary key. I'll call it TempID. """

My table has 'FieldID' as an autonumber field and is the primary key.

The page sa ys:

DELETE <yourtable>.* FROM <yourtable> WHERE TempID IN(SELECT MIN(TempID) AS MinOfTempID FROM <yourtable> Group By [Name] Having Count(TempID) > 1)

I have edited to this:

DELETE <students>.* FROM <students> WHERE FieldD IN(SELECT MIN(FieldID) AS MinOfFieldID FROM <students> Group By [fieldid] Having Count(fieldID) > 1)

and I still get an error.  (The marker appears at the second <students> above.)

What Have I missed?

Many thanks,

Robin Chapple

__._,_.___

Posted by: Robin Chapple <robinski@westnet.com.au>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

.

__,_._,___

Tidak ada komentar:

Posting Komentar