ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel appending to Access - no duplicates (https://www.excelbanter.com/excel-discussion-misc-queries/121142-excel-appending-access-no-duplicates.html)

zeyneddine

Excel appending to Access - no duplicates
 
Hi,
I am trying to write a macro which would take the contents of one table in
Access and append to another table, but am trying to prevent duplicates,
through Excel.
My query is as below:

Insert into Funding
Select LinkedFunding.*
From LinkedFunding;

How do I verify that no duplicates are made? The primary key is Instrument.
I could potentionally determine duplicates based on same instrument on the
same day, that is instrument ABC for 11/29 and again ABC for 11/29. I can
have ABC for 11/30 but not two records of instrument ABC for 11/29 or 11/30.

Please assist.

stumac

Excel appending to Access - no duplicates
 
Hi Zeyneddine, as long as by duplicates you mean exact copies you could use:

INSERT INTO Funding
SELECT DISTINCT *
FROM LinkedFunding;


Hope this helps
Stu

"zeyneddine" wrote:

Hi,
I am trying to write a macro which would take the contents of one table in
Access and append to another table, but am trying to prevent duplicates,
through Excel.
My query is as below:

Insert into Funding
Select LinkedFunding.*
From LinkedFunding;

How do I verify that no duplicates are made? The primary key is Instrument.
I could potentionally determine duplicates based on same instrument on the
same day, that is instrument ABC for 11/29 and again ABC for 11/29. I can
have ABC for 11/30 but not two records of instrument ABC for 11/29 or 11/30.

Please assist.


zeyneddine

Excel appending to Access - no duplicates
 
No it doesnt at all.

As I said, the duplicates meaning the table that is being APPENDED does not
have duplicates. The query you gave is the most basic thing ever. Give me
some credit dude.

What I need is that no records be entered into Funding from LinkedFunding
that are ALREADY present in Funding.

Is there no smart dude here?

"stumac" wrote:

Hi Zeyneddine, as long as by duplicates you mean exact copies you could use:

INSERT INTO Funding
SELECT DISTINCT *
FROM LinkedFunding;


Hope this helps
Stu

"zeyneddine" wrote:

Hi,
I am trying to write a macro which would take the contents of one table in
Access and append to another table, but am trying to prevent duplicates,
through Excel.
My query is as below:

Insert into Funding
Select LinkedFunding.*
From LinkedFunding;

How do I verify that no duplicates are made? The primary key is Instrument.
I could potentionally determine duplicates based on same instrument on the
same day, that is instrument ABC for 11/29 and again ABC for 11/29. I can
have ABC for 11/30 but not two records of instrument ABC for 11/29 or 11/30.

Please assist.


test

Excel appending to Access - no duplicates
 

Create an index in the FUNDING table that takes into account all fields
that make the record unique (as long as this isn't over 10 fields) and set
the unique property to yes access will then reject the duplicates.

Stu


"zeyneddine" wrote in message
...
No it doesnt at all.

As I said, the duplicates meaning the table that is being APPENDED does
not
have duplicates. The query you gave is the most basic thing ever. Give me
some credit dude.

What I need is that no records be entered into Funding from LinkedFunding
that are ALREADY present in Funding.

Is there no smart dude here?

"stumac" wrote:

Hi Zeyneddine, as long as by duplicates you mean exact copies you could
use:

INSERT INTO Funding
SELECT DISTINCT *
FROM LinkedFunding;


Hope this helps
Stu

"zeyneddine" wrote:

Hi,
I am trying to write a macro which would take the contents of one table
in
Access and append to another table, but am trying to prevent
duplicates,
through Excel.
My query is as below:

Insert into Funding
Select LinkedFunding.*
From LinkedFunding;

How do I verify that no duplicates are made? The primary key is
Instrument.
I could potentionally determine duplicates based on same instrument on
the
same day, that is instrument ABC for 11/29 and again ABC for 11/29. I
can
have ABC for 11/30 but not two records of instrument ABC for 11/29 or
11/30.

Please assist.





All times are GMT +1. The time now is 09:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com