Append Query

G

Guest

I am struggling with an “Append Queryâ€. Here is what I have:
+ a table with “Prospect IDs†and other information about prospects
+ a table with “Mailer IDs†and other information about mailers
+ a table called “Mailings†with fields for “Prospect IDs†and “Mailer IDsâ€

My logic is to run an Append Query with selection criteria on the prospects
and selection criteria which identifies a specific “Mailerâ€. The results
would create records in the “Mailings†table of “Prospect IDs†and “Mailer
IDsâ€, but it just isn’t working for me. Perhaps I have a fundamental issue
with what I am trying to do or perhaps I’m only one simple step away. Any
ideas would be appreciated.
 
C

Chris L via AccessMonster.com

You need something like:-

INSERT INTO tblMailings ( ProspectID, MailerID )
SELECT tblProspects.ProspectID, tblMailers.MailerID
FROM tblProspects, tblMailers
WHERE (criteria on tblProspects go here) AND ((criteria on tblMailers go here)



hth

Chris
 
G

Guest

Thanks for your reply.

Where exactly do I put these statements? Someplace in the "Design View"?

I tried using the Query Wizzard, but it defaults to a "Select Query" and
when I converted the Select Query to an "Append Query" I still couldn't get
it to work.

Can you use the Query Wizzard to create an Append Query?

Thanks
 
C

Chris L via AccessMonster.com

Create a new query in Design view, add the Prospects and Mailers tables. Then
from the Query Menu choose Append Query and select the Mailings table. Add
the Primary keys from the 2 tables and the AppendTo line should be auto
filled in. Then add any other fields you need along with their criteria.
If you then change to SQL view (from the Query menu) you should see code like
in my first post - you could also start with this view and just type in the
SQL.

hth

Chris
Thanks for your reply.

Where exactly do I put these statements? Someplace in the "Design View"?

I tried using the Query Wizzard, but it defaults to a "Select Query" and
when I converted the Select Query to an "Append Query" I still couldn't get
it to work.

Can you use the Query Wizzard to create an Append Query?

Thanks
You need something like:-
[quoted text clipped - 18 lines]
 
G

Guest

Thanks Chris, that really helps. It also helped me better understand what SQL
was all about. Cheers.

Chris L via AccessMonster.com said:
Create a new query in Design view, add the Prospects and Mailers tables. Then
from the Query Menu choose Append Query and select the Mailings table. Add
the Primary keys from the 2 tables and the AppendTo line should be auto
filled in. Then add any other fields you need along with their criteria.
If you then change to SQL view (from the Query menu) you should see code like
in my first post - you could also start with this view and just type in the
SQL.

hth

Chris
Thanks for your reply.

Where exactly do I put these statements? Someplace in the "Design View"?

I tried using the Query Wizzard, but it defaults to a "Select Query" and
when I converted the Select Query to an "Append Query" I still couldn't get
it to work.

Can you use the Query Wizzard to create an Append Query?

Thanks
You need something like:-
[quoted text clipped - 18 lines]
with what I am trying to do or perhaps I’m only one simple step away. Any
ideas would be appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top