Query Assistance Please - my brain is fried.

G

Guest

I would greatly appreciate assistance in designing a Query for the 2 tables below.
I need to combine or join the tables into a single final table named "combined"

I have tried various queries with no success. I kind of feel like I have lost my keys.. its right there in front of me but I don't see them.

Table 1 is as follows & contains 5019 records

PRIMARY . ci FIRST NAME . ci MIDDLE INITIAL . ci LAST NAME . ci SUFFIX . ci NNS . ci DOB . ci STREET1 . c1 STREET2 . ci CITY . ci STATE . ci ZIP . *FIRST NAME . *MIDDLE NAME . *LAST NAME . PREFIX . SUFFIX . SECONDARY ADDRESS .
*PRIMARY ADDRESS . *CITY . *STATE . *ZIP . *FIELD 11 . *PHONE . *EDT NNS . NNS MATCH LEVEL . NNS DECEASED IND . PHONE PANDER FLAG . DMA PANDER FLAG . TOTAL PANDER FLAG . INVALID INPUT FLAG . RECIPIENT RELIABILITY FLAG

Table 2 is contructed below & contains 1402 records:

Prtimary . First Name . Middle Name . Last Name . EDD NNS . Primary Address . City . State . Zip . Field 11(empty, no data) . Phone

I need to have the records from table 2 added to the fields in table 1 where the "*" is indicated. These fields contain no data but need to be appended to the data file from table 1 with the records from table 2.

Thanks much !
 
P

Petrucci2000

--------------------
| Thread-Topic: Query Assistance Please - my brain is fried.
| thread-index: AcPeEhk2ekw8CRS2Q7y2Z48DOeBUug==
| X-Tomcat-NG: microsoft.public.access.queries
| From: "=?Utf-8?B?SkI=?=" <[email protected]>
| Subject: Query Assistance Please - my brain is fried.
| Date: Sun, 18 Jan 2004 14:26:21 -0800
| Lines: 18
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.queries
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.queries:186673
| X-Tomcat-NG: microsoft.public.access.queries
|
| I would greatly appreciate assistance in designing a Query for the 2
tables below.
<I need to combine or join the tables into a single final table named
"combined"

<I have tried various queries with no success. I kind of feel like I have
lost my keys.. its right there <in front of me but I don't see them.

<Table 1 is as follows & contains 5019 records

<PRIMARY . ci FIRST NAME . ci MIDDLE INITIAL . ci LAST NAME . ci SUFFIX
.. ci NNS . ci <DOB . ci STREET1 . c1 STREET2 . ci CITY . ci STATE . ci
ZIP . *FIRST NAME . *MIDDLE <NAME . *LAST NAME . PREFIX . SUFFIX
.. SECONDARY ADDRESS .
*PRIMARY ADDRESS . *CITY . *STATE . *ZIP . *FIELD 11 . *PHONE . *EDT NNS
.. NNS MATCH <LEVEL . NNS DECEASED IND . PHONE PANDER FLAG . DMA PANDER
FLAG . TOTAL PANDER <FLAG . INVALID INPUT FLAG . RECIPIENT RELIABILITY FLAG

<Table 2 is contructed below & contains 1402 records:

<Prtimary . First Name . Middle Name . Last Name . EDD NNS . Primary
Address . City . State . Zip . <Field 11(empty, no data) . Phone

<I need to have the records from table 2 added to the fields in table 1
where the "*" is indicated. <These fields contain no data but need to be
appended to the data file from table 1 with the <records from table 2.

<Thanks much !

Have you tried:
INSERT INTO Table1 ( [First Name], [Middle Name], [Last Name], [EDD NNS],
[Primary Address],[City], [State],[Zip],[Field 11],[Phone])
SELECT Table2.[First Name], Table2.[Middle Name], Table2.[Last Name],
Table2.[EDD NNS], Table2.[Primary Address],Table2.[City],
Table2.[State],Table2.[Zip],Table2.[Field 11],Table2.[Phone]
FROM Table2;

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.

Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."
 
T

Tom

One option is to use a Union Select Query. If you type
Union Select into Access Help it will provide you with
step by step instructions.

Once you have the union query completed you can use an
append query to insert it all into one table.

Tom
-----Original Message-----
I would greatly appreciate assistance in designing a Query for the 2 tables below.
I need to combine or join the tables into a single final table named "combined"

I have tried various queries with no success. I kind of
feel like I have lost my keys.. its right there in front
of me but I don't see them.
Table 1 is as follows & contains 5019 records

PRIMARY . ci FIRST NAME . ci MIDDLE INITIAL . ci LAST
NAME . ci SUFFIX . ci NNS . ci DOB . ci STREET1 . c1
STREET2 . ci CITY . ci STATE . ci ZIP . *FIRST NAME .
*MIDDLE NAME . *LAST NAME . PREFIX . SUFFIX .
SECONDARY ADDRESS .
*PRIMARY ADDRESS . *CITY . *STATE . *ZIP . *FIELD 11 .
*PHONE . *EDT NNS . NNS MATCH LEVEL . NNS DECEASED
IND . PHONE PANDER FLAG . DMA PANDER FLAG . TOTAL PANDER
FLAG . INVALID INPUT FLAG . RECIPIENT RELIABILITY FLAG
Table 2 is contructed below & contains 1402 records:

Prtimary . First Name . Middle Name . Last Name . EDD
NNS . Primary Address . City . State . Zip . Field 11
(empty, no data) . Phone
I need to have the records from table 2 added to the
fields in table 1 where the "*" is indicated. These fields
contain no data but need to be appended to the data file
from table 1 with the records from table 2.
 
G

Guest

Thanks. I wonder if you would provide additional info. I did attempt your suggestion of Insert Into Table 1 but Access said it did not see a relationship plus additional info about child and parent tables.

I would greatly appreciate whatever suggestions you have. The simplier the better.

Thanks




----- \"Petrucci2000\" wrote: -----


--------------------
| Thread-Topic: Query Assistance Please - my brain is fried.
| thread-index: AcPeEhk2ekw8CRS2Q7y2Z48DOeBUug==
| X-Tomcat-NG: microsoft.public.access.queries
| From: "=?Utf-8?B?SkI=?=" <[email protected]>
| Subject: Query Assistance Please - my brain is fried.
| Date: Sun, 18 Jan 2004 14:26:21 -0800
| Lines: 18
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.access.queries
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| Path: cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl
| Xref: cpmsftngxa07.phx.gbl microsoft.public.access.queries:186673
| X-Tomcat-NG: microsoft.public.access.queries
|
| I would greatly appreciate assistance in designing a Query for the 2
tables below.
<I need to combine or join the tables into a single final table named
"combined"

<I have tried various queries with no success. I kind of feel like I have
lost my keys.. its right there <in front of me but I don't see them.

<Table 1 is as follows & contains 5019 records

<PRIMARY . ci FIRST NAME . ci MIDDLE INITIAL . ci LAST NAME . ci SUFFIX
. ci NNS . ci <DOB . ci STREET1 . c1 STREET2 . ci CITY . ci STATE . ci
ZIP . *FIRST NAME . *MIDDLE <NAME . *LAST NAME . PREFIX . SUFFIX
. SECONDARY ADDRESS .
*PRIMARY ADDRESS . *CITY . *STATE . *ZIP . *FIELD 11 . *PHONE . *EDT NNS
. NNS MATCH <LEVEL . NNS DECEASED IND . PHONE PANDER FLAG . DMA PANDER
FLAG . TOTAL PANDER <FLAG . INVALID INPUT FLAG . RECIPIENT RELIABILITY FLAG

<Table 2 is contructed below & contains 1402 records:

<Prtimary . First Name . Middle Name . Last Name . EDD NNS . Primary
Address . City . State . Zip . <Field 11(empty, no data) . Phone

<I need to have the records from table 2 added to the fields in table 1
where the "*" is indicated. <These fields contain no data but need to be
appended to the data file from table 1 with the <records from table 2.

<Thanks much !

Have you tried:
INSERT INTO Table1 ( [First Name], [Middle Name], [Last Name], [EDD NNS],
[Primary Address],[City], [State],[Zip],[Field 11],[Phone])
SELECT Table2.[First Name], Table2.[Middle Name], Table2.[Last Name],
Table2.[EDD NNS], Table2.[Primary Address],Table2.[City],
Table2.[State],Table2.[Zip],Table2.[Field 11],Table2.[Phone]
FROM Table2;

I hope this helps! If you have additional questions on this topic, please
respond back to this posting.

Regards,

Eric Butts
Microsoft Access Support

"Microsoft Security Announcement: Have you installed the patch for
Microsoft Security Bulletin MS03-026? If not Microsoft strongly advises
you to review the information at the following link regarding Microsoft
Security Bulletin MS03-026
<http://www.microsoft.com/security/security_bulletins/ms03-026.asp> and/or
to visit Windows Update at <http://windowsupdate.microsoft.com/> to install
the patch. Running the SCAN program from the Windows Update site will help
to insure you are current with all security patches, not just MS03-026."
 

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