473,418 Members | 4,802 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,418 software developers and data experts.

I would like to delete records found in an unmatched query from the originating table

Is there a way to automate this process?

I have a query that finds the "Drop Offs" by doing an unmatch query against the hard table and the live table.

I want to automatically pull these "Drop Offs" out of the Hard table.

my sql for the query I am running follows:

1st Query - pulls the data from the live tables.

SELECT vewEmployeeLogin.PersonID, vewEmployeeLogin.User AS LOGIN, " " AS [PASSWORD], vewEmployeeLogin.[First Name] AS [FIRST NAME], vewEmployeeLogin.[Last Name] AS [LAST NAME], Max(IIf([TELECOMMTYPEID]=2,[TELECOMMVALUE],"")) AS EMAIL, Max(IIf([TELECOMMTYPEID]=1,[TELECOMMVALUE],"")) AS PHONE, "YES" AS EmployeeActive
FROM ((tblEmployee LEFT JOIN tblPerson_Telecomm ON tblEmployee.PersonId = tblPerson_Telecomm.PersonID) LEFT JOIN tblTelecomm ON tblPerson_Telecomm.TelecommID = tblTelecomm.TelecommID) RIGHT JOIN vewEmployeeLogin ON tblEmployee.PersonId = vewEmployeeLogin.PersonID
GROUP BY vewEmployeeLogin.PersonID, vewEmployeeLogin.User, vewEmployeeLogin.[First Name], vewEmployeeLogin.[Last Name], "YES";

2nd query - compairs data in Hard Table to the Live table and spits out the unmatched ones.

SELECT tblCRCTPanasonicLMSOriginal.PersonID, tblCRCTPanasonicLMSOriginal.LOGIN, tblCRCTPanasonicLMSOriginal.PASSWORD, tblCRCTPanasonicLMSOriginal.[FIRST NAME], tblCRCTPanasonicLMSOriginal.[LAST NAME], tblCRCTPanasonicLMSOriginal.EMAIL, tblCRCTPanasonicLMSOriginal.PHONE, tblCRCTPanasonicLMSOriginal.STATUS
FROM tblCRCTPanasonicLMSOriginal LEFT JOIN qryCRCTPanasonicLMS ON tblCRCTPanasonicLMSOriginal.PersonID = qryCRCTPanasonicLMS.PersonID
WHERE (((qryCRCTPanasonicLMS.PersonID) Is Null));

Hard Table is the results of the 1st query that I pulled a week ago.

Live Table is a combination of several tables on and SQL Server - which is what the 1st query pulls.


Any help would be nice in creating some sort of delete query to delete the records pulled by the 2nd query from the Hard Table.

Thanks!
Sophie
Aug 23 '07 #1
2 1914
missinglinq
3,532 Expert 2GB
You have inadvertently posted your question in the Articles section rather than in the Forum section of our site, so I have moved it across to the Forum for you.

Linq ;0)>
Aug 23 '07 #2
Thank you very much! I was wondering why I couldn't find it!
Aug 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Reply via newsgroup | last post by:
Folks, When performing an update in mysql (using PHP), can I find out how many records were matched? mysql_affected_rows() won't work... and I have the following problem that I thought I...
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...
1
by: Megan | last post by:
Hi everybody- For some reason, I cannot get this query to work. I have 2 identical tables. One table is new, the other is old. I want to be able to tell which records in the newer table are...
8
by: John Baker | last post by:
Hi: Access 2000 W98! I have a table with numerous records in it, and am attempting to delete certain records that have been selected from it. These are selected based on the ID number in a...
7
by: Ray | last post by:
I have a input form linked to a table and found the total no of records on the bottom bar is different from that of table. Can someone advise an effective way to find out the different records...
8
by: paulwilliamsonremove | last post by:
Hi, Using Access 2003. I am trying to delete records from one table/query ("qryHistoryPersonIDs") if they don't exist in another table ("qryDonations"). But the SQL syntax I came up with is...
2
by: Cornelius Buschka | last post by:
Hi, we saw the following problem: We deleted all rows from a table B referencing table A (~500000 records). No problem, but the following try to delete all records from table A (~180000) lead...
17
by: (PeteCresswell) | last post by:
I've got apps where you *really* wouldn't want to delete certain items by accident, but the users just have to have a "Delete" button. My current strategies: Plan A:...
1
by: Charlotte | last post by:
Hallo, Graag hulp, want ik heb zelf geen oplossing Al gegoogeld, doch zonder concreet resultaat Op onze webserver (intranet) hebben we een website draaien Een bepaalde ASP-pagina haalt zijn...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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
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...

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.