473,396 Members | 2,121 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Delete duplicate data in Access

Hi MS Access & MS SQL Server Gurus !

I am trying to delete duplicate data from a LINKED SQL Server 2000
table (LinkedTable) and insert the result into a local (in Access)
table.

The following code works in SQL Server 2000 but NOT in Access, could
any one tell me what's wrong with it?

SELECT a.id, a.change_id AS chgid, a.Action_desc as Actiondescr INTO
LocalTable
From dbo.LinkedTable as a
Where a.id = (
Select TOP 1 b.id
From dbo.LinkedTable as b
Where a.change_id = b.change_id
Order By b.time_stamp)

Thanks in advance !
Nov 13 '05 #1
1 2356

"Charles" <de*********@hotmail.com> wrote in message
news:be**************************@posting.google.c om...
Hi MS Access & MS SQL Server Gurus !

I am trying to delete duplicate data from a LINKED SQL Server 2000
table (LinkedTable) and insert the result into a local (in Access)
table.

The following code works in SQL Server 2000 but NOT in Access, could
any one tell me what's wrong with it?

SELECT a.id, a.change_id AS chgid, a.Action_desc as Actiondescr INTO
LocalTable
From dbo.LinkedTable as a
Where a.id = (
Select TOP 1 b.id
From dbo.LinkedTable as b
Where a.change_id = b.change_id
Order By b.time_stamp)

Thanks in advance !


no code please is stupid. you make 1 query and do job easy.

1 query is access SELECT find all record you want deleted. run query on sql
table. is OK? find all record you want deleted? OK now you turn SELECT to
APPEND you get data OK into local table yes? now you turn APPEND to
DELETE. you get sql record deleted. all simple 1 query please.

*Sherwood Wang MVP*

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

44
by: Xah Lee | last post by:
here's a large exercise that uses what we built before. suppose you have tens of thousands of files in various directories. Some of these files are identical, but you don't know which ones are...
2
by: Barbara | last post by:
Hi, I have an sql database that has the primary key set to three fields, but has not been set as unique(I didn't create the table). I have 1 record that has 2 duplicates and I am unable to delete...
3
by: Alexander Anderson | last post by:
I have a DELETE statement that deletes duplicate data from a table. It takes a long time to execute, so I thought I'd seek advice here. The structure of the table is little funny. The following is...
11
by: suma | last post by:
Hello, I want to delete duplicate rows in a table when no primary key is defined. For eg: If we have table1 with data as below, Suma 23 100 Suma 23 100 I want to delete a row from this...
2
by: Pablo | last post by:
Hello, there, I have a table tblData which has pharmacy data. The table has following fields: ClaimNum, LineNum... The ClaimNum has claim number which is 12 characters. LineNum is NULL. The...
2
by: ms | last post by:
Access 2000: I am trying to delete duplicate records imported to a staging table leaving one of the duplicates to be imported into the live table. A unique record is based on a composite key of 3...
8
by: Brian L. Troutwine | last post by:
I've got a problem that I can't seem to get my head around and hoped somebody might help me out a bit: I've got a dictionary, A, that is arbitarily large and may contains ints, None and more...
16
by: Theodore70 | last post by:
I am trying to delete duplicate records in an access table using VB. Not a programmer here, but this was one of the codes that I found on the web. I made some modifications to it, but it still did...
7
by: jmstur2 | last post by:
I have a table with what I consider duplicate records. Data in all columns are duplicate except for the date column, meaning that duplicate data was entered on different dates and those dates were...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.