PC Review


Reply
Thread Tools Rate Thread

Access 2003 - Combine data from 4 query then update to 1 table

 
 
izwan noor
Guest
Posts: n/a
 
      28th Oct 2008
Dear sir,

Good morning..My problem is i've 4 query, then i would like to extract the
data from these query then update to 1 table using 1 query.

For example.

Query 1: SUM_X
Query 2: SUM_X
Query 3: SUM_X
Query 4: SUM_X

Table_1
---------
NO DATA SUM_X
1 Query 1 XXXXX
2 Query 2 XXXXX
3 Query 3 XXXXX
4 Query 4 XXXXX

These table will be update if the user use "combine query". How could i do
these?Pleae help me...

Thank you..
 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      28th Oct 2008
Use a UNION query to combine the data from 4 sources. Then change it into an
Append query to write the results to the target table.

Access cannot show you a UNION query graphically, so you will be working in
SQL language here.

Presumably this is just for import purposes, i.e. you don't really have 4
different tables in the end.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"izwan noor" <(E-Mail Removed)> wrote in message
news:E0C91614-4135-42F3-8049-(E-Mail Removed)...
> Dear sir,
>
> Good morning..My problem is i've 4 query, then i would like to extract the
> data from these query then update to 1 table using 1 query.
>
> For example.
>
> Query 1: SUM_X
> Query 2: SUM_X
> Query 3: SUM_X
> Query 4: SUM_X
>
> Table_1
> ---------
> NO DATA SUM_X
> 1 Query 1 XXXXX
> 2 Query 2 XXXXX
> 3 Query 3 XXXXX
> 4 Query 4 XXXXX
>
> These table will be update if the user use "combine query". How could i do
> these?Pleae help me...
>
> Thank you..


 
Reply With Quote
 
izwan noor
Guest
Posts: n/a
 
      29th Oct 2008
Dear Allen,

how could i change from UNION query to APPEND query..It is i've to write it
in SQL language?

Thank you....

"Allen Browne" wrote:

> Use a UNION query to combine the data from 4 sources. Then change it into an
> Append query to write the results to the target table.
>
> Access cannot show you a UNION query graphically, so you will be working in
> SQL language here.
>
> Presumably this is just for import purposes, i.e. you don't really have 4
> different tables in the end.
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "izwan noor" <(E-Mail Removed)> wrote in message
> news:E0C91614-4135-42F3-8049-(E-Mail Removed)...
> > Dear sir,
> >
> > Good morning..My problem is i've 4 query, then i would like to extract the
> > data from these query then update to 1 table using 1 query.
> >
> > For example.
> >
> > Query 1: SUM_X
> > Query 2: SUM_X
> > Query 3: SUM_X
> > Query 4: SUM_X
> >
> > Table_1
> > ---------
> > NO DATA SUM_X
> > 1 Query 1 XXXXX
> > 2 Query 2 XXXXX
> > 3 Query 3 XXXXX
> > 4 Query 4 XXXXX
> >
> > These table will be update if the user use "combine query". How could i do
> > these?Pleae help me...
> >
> > Thank you..

>
>

 
Reply With Quote
 
Allen Browne
Guest
Posts: n/a
 
      29th Oct 2008
Yes: you will need to write this.

However, you can mock up an example easily.
Create a query based on just one table.
Change it to an Append query (Append on Query menu.)
Map the fields.
Switch to SQL View.
You now have an example of what the Append query statement should look like.
Provided the fields are in the same order as your UNION query, you may be
able to just copy'n'paste the first clause of the Append query, i.e. INSERT
INTO ...

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"izwan noor" <(E-Mail Removed)> wrote in message
news:3369D101-78EC-41CF-BF44-(E-Mail Removed)...
> Dear Allen,
>
> how could i change from UNION query to APPEND query..It is i've to write
> it
> in SQL language?
>
> Thank you....
>
> "Allen Browne" wrote:
>
>> Use a UNION query to combine the data from 4 sources. Then change it into
>> an
>> Append query to write the results to the target table.
>>
>> Access cannot show you a UNION query graphically, so you will be working
>> in
>> SQL language here.
>>
>> Presumably this is just for import purposes, i.e. you don't really have 4
>> different tables in the end.
>>
>> "izwan noor" <(E-Mail Removed)> wrote in message
>> news:E0C91614-4135-42F3-8049-(E-Mail Removed)...
>> > Dear sir,
>> >
>> > Good morning..My problem is i've 4 query, then i would like to extract
>> > the
>> > data from these query then update to 1 table using 1 query.
>> >
>> > For example.
>> >
>> > Query 1: SUM_X
>> > Query 2: SUM_X
>> > Query 3: SUM_X
>> > Query 4: SUM_X
>> >
>> > Table_1
>> > ---------
>> > NO DATA SUM_X
>> > 1 Query 1 XXXXX
>> > 2 Query 2 XXXXX
>> > 3 Query 3 XXXXX
>> > 4 Query 4 XXXXX
>> >
>> > These table will be update if the user use "combine query". How could i
>> > do
>> > these?Pleae help me...


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update local table with Sybase ODBC data in update query ragtopcaddy via AccessMonster.com Microsoft Access 4 26th Nov 2007 03:17 PM
Update Query from Access 2003 Linked Table Hendy88@gmail.com Microsoft Access 1 7th Feb 2007 05:43 PM
Update one table with data from another table based on a query Azzna Microsoft Access Form Coding 2 29th Jan 2007 07:44 PM
Update query to coppy data from 1 table into another table ghadley_00@yahoo.com Microsoft Access Queries 1 24th Dec 2005 04:17 AM
Access - Combine Data in a Query Al Mackay Microsoft Access Queries 1 16th Jul 2004 11:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:36 PM.