If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
Append Query Help Needed
That worked Perfect!
Thanks, Hank "John Spencer" wrote in message ... Assumption: Tbl3.ColA is never null. Try the following to identify the records in tbl2 SELECT TBL2.COLa, TBL2.COLb, TBL2.COLc FROM TBL2 LEFT JOIN TBL3 ON TBL2.COLa Like "*" & TBL3.COLa & "*" WHERE TBL3.COLa IS NULL; IF the above works then try INSERT INTO TBL1 (ColA, ColB, ColC) SELECT TBL2.COLa, TBL2.COLb, TBL2.COLc FROM TBL2 LEFT JOIN TBL3 ON TBL2.COLa Like "*" & TBL3.COLa & "*" WHERE TBL3.COLa IS NULL; wrote: Getting Closer. Thanks for your persistence in assisting me. Using the following query, I get the records that meet the criteria in TBL3.COLa SELECT TBL2.COLa, TBL2.COLb, TBL2.COLc FROM TBL2 INNER JOIN TBL3 ON TBL2.COLa Like "*" & TBL3.COLa & "*" WHERE TBL3.COLa IS NOT NULL; How would I go about doing the exact opposite. Looking for the records that do not meet the criteria in TBL3,COLa? TBL1 is where the data needs to go. TBL2 is where the data currently exists. TBL3 is where the the criteria for what I do not want exists. Hank "John Spencer" wrote in message ... To identify the records in Tbl1 that you want you could use a non-equi join. Note that this type of join cannot be built or shown in the query grid. SELECT tbl1.Col1, Tbl1.Col2, Tbl1.Col3 FROM Tbl1 INNER JOIN tbl2 ON Tbl1.Col1 Like "*" & tbl2.Col1 & "*" WHERE Tbl2.Col1 IS NOT NULL Once this is working to identify the records you can turn it into an append query INSERT Into Tbl3 (ColA, ColB, ColC) SELECT tbl1.Col1, Tbl1.Col2, Tbl1.Col3 FROM Tbl1 INNER JOIN tbl2 ON Tbl1.Col1 Like "*" & tbl2.Col1 & "*" WHERE Tbl2.Col1 IS NOT NULL I really don't understand by you need an append query to add records to third table when you should be able to just use the Select query and have it always returning the desired matches when it is called. wrote: My CSRs are each responsible for reviewing their section of the alphabet looking for similarities. To assist them, I need an Append Query that looks something like this: TBL1, COL1 If TBL2, COL1 has a partial match to TBL1, COL1 Then Move TBL1, Entire Record to TBL3 All Three TBLs already exist, as do the TBL Structures and there is no relationship between the TBLs. Can someone please assist me with the correct SQL syntax? TBL2, COL1 has precise partial information, such as Johnson. Thanks, Hank |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Toolbars, Drop-Down Menus | Rick | New Users | 1 | September 21st, 2005 11:17 AM |
Link CSV file created query append query to append data | esparzaone | Running & Setting Up Queries | 2 | July 5th, 2005 04:49 PM |
Append Query Problem | Santara | General Discussion | 3 | July 5th, 2005 04:32 PM |
Here's a shocker | Mike Labosh | General Discussion | 2 | October 26th, 2004 05:04 PM |
append Query duplicating records | Alex | Running & Setting Up Queries | 1 | July 8th, 2004 01:31 PM |