By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,241 Members | 733 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,241 IT Pros & Developers. It's quick & easy.

Check for Duplicate Data

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.