User Profile
Collapse
-
The Macro script worked perfectly for what I was trying to accomplish and was an easy fix. -
Union or Otherwise Combine Multiple Delete Queries
I have 3 separate delete queries that I would like to either : Union together so they can be run in one click or re-write so that I can perform all the actions in a single query. I have so far been unable to do so. The queries are as follows:
Delete Duplicate Leads
...Code:DELETE WorkBook.*, Exists (select 1 from Leads WHERE WorkBook.Email=Leads.Email) AS Expr1 FROM WorkBook WHERE -
There must be some "user" error or something I have overlooked.
When I started to use your first solution with test data, it works perfectly.
I will have to take a closer look why it will not work with my real data.
Thank you for all your help. I will mark your first response as the correct solution and create a new post if and when I identify the issue with my data.Leave a comment:
-
ADezii,
Give me a few moments to build out an example that I can share, I'm working with sensitive information. I'll attach some additional links in just a few minutes.Leave a comment:
-
-
-
ADezii,
We are painfully close.
Your last post just produces a copy of the WorkBook and has removed the 4 records it was identifying before. So, roughly the opposite effect.
To summarize:
Your initial code successfully identified the matches between [Customers] and [WorkBook], including wildcards and filtered them to the top of the table. However, it included a copy of the entire [WorkBook] table...Leave a comment:
-
I tried reversing the last line as such:
SELECT WorkBook.ID, WorkBook.Author name, WorkBook.FirstN ame, WorkBook.LastNa me, WorkBook.Title, WorkBook.Email, WorkBook.Compan y, WorkBook.[Lead Status]
FROM WorkBook, Customers
WHERE Customers.Compa ny Like "*" & [WorkBook].[Company] & "*";
This brings back being unable to identify wildcards but pulling exact matches.Leave a comment:
-
If you follow the link to the image, you'll see that the records at the top 12,13,14 and 11 are the correct records that I wanted to identify with this query.
Unfortunately having all of the records from WorkBook duplicated below it is ruining what I was trying to achieve.
Is there a way to filter out 1-14 and only keep the 12,13,14,11 using a single query? Will I have to do another query to remove duplicates?Leave a comment:
-
-
-
ADezii,
Excellent! Your solution does in fact pull the items like I want it to. It even seems to sort them at the top of the list.
The only issue I have is that it also includes ALL of the records from WorkBook below. (So now I have duplicate records and records I didn't want identified at all.)
I will post a screen shot for clarification, but can only show the IDs as some of the other data is sensitive.Leave a comment:
-
Hi Phil,
I tried it as follows:
SELECT WorkBook.ID, WorkBook.Author name, WorkBook.FirstN ame, WorkBook.LastNa me, WorkBook.Title, WorkBook.Email, WorkBook.Compan y, WorkBook.[Lead Status]
FROM WorkBook LEFT JOIN Customers ON WorkBook.[Company] = Customers.[Company]
WHERE (((Customers.Co mpany) Like "*" & [WorkBook.Compan y] & "*"));
This produced...Leave a comment:
-
Query two tables and duplicates with wildcards
Hello to all.
I am comparing two tables [Customers] and [Workbook]
I am trying to identify, in the table [WorkBook] places where the "Company" field is similar or the same to the Customers.Compa ny
I am now able to successfully identify exact matches, but what I need is to place wildcards on either side of my search function.
I have the following SQL statement
...Code:SELECT WorkBook.ID,
Last edited by zmbd; Aug 28 '16, 10:23 PM. Reason: [z{merged two threads and the posts. Please do not double post your questions.}{Placed required Code tags}]
No activity results to display
Show More
Leave a comment: