A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Append Query Help Needed



 
 
Thread Tools Display Modes
  #11  
Old March 18th, 2006, 11:54 PM posted to microsoft.public.access.queries
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 11:52 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.