473,507 Members | 3,706 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Check for Duplicate Data

I have a temp table that has data I am inserting into a SQL DB table.

There is a column in both tables called PAT_ID. I need to check the SQL
table against the temp table for duplicate data in both columns of both
tables.

In other words if one row in the temp table PAT_ID has a value of 472440 and
the SQL DB table also has a row with PAT_ID = 472440 then I want to delete
the temp table row.

Does that make sense??

Thanks for any insight!!

Mike
m charney at dunlap hospital dot org

Is life the same when it goes backwards?


May 12 '06 #1
2 1743
Hi Mike,

Try

Docmd.RunSql "Delete From temp where Pat_ID IN (Select Pat_ID from
SqlTbl)"

Rich

*** Sent via Developersdex http://www.developersdex.com ***
May 12 '06 #2
Thanks Rich!!

That worked like a charm!!

Mike

"Rich P" <rp*****@aol.com> wrote in message
news:lQ***************@news.uswest.net...
Hi Mike,

Try

Docmd.RunSql "Delete From temp where Pat_ID IN (Select Pat_ID from
SqlTbl)"

Rich

*** Sent via Developersdex http://www.developersdex.com ***

May 12 '06 #3

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

Similar topics

1
1584
by: richmarin | last post by:
I am using Access 2002 I have the following task. I have to do a duplicate check on two fields. The logic is, for a given day, and a given id, how many managers shared that same ID on that day....
2
2513
by: Mike N. | last post by:
Hello again.. I have a table with a text field named "Requisition" (Indexed, no dupes). It is not the key field. This field is the first text box on a form. I would like to check to make sure the...
1
1546
by: d9pierce | last post by:
Hi all, I have a company form that I would like to protect against duplication unless checked. Main point being, that I dont want to just be able to add a duplicate company name in a test box...
8
3910
by: Iona | last post by:
Hi Allan, I'm using a nifty piece of code you put on here some time back to do a duplicate entry check as below. I'm using to check for duplicate names. However I am getting an error message on...
5
2572
by: Alan Little | last post by:
I have affiliates submitting batches of anywhere from 10 to several hundred orders. Each order in the batch must include an order ID, originated by the affiliate, which must be unique across all...
20
14353
by: technocraze | last post by:
Hi guys & commnunity experts, Does anyone knw how to go about checking for existing data in an MS Acess table? I have tried out the following code using vb but doesnt seem to work that well? Can...
3
16761
by: wongray | last post by:
Hello, I need help. I have a form and I would like to do a check when I enter a data into the field and once I press enter into the field it will check whether is duplicate or not. currently...
2
2533
by: Ranma13 | last post by:
Hello, I have a duplicate record check written in VB for a check in/check out database. Here's the pseudocode, written for the BeforeUpdate property on the form: If DCount(search for records with...
1
2009
by: gurmet | last post by:
Hi All I have been looking around for help, and finally post this problem. I created a form to edit a record. Before i can click save button on the edit form i need to check if the data that...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
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,...
1
7029
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
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
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,...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.