create query from unrelated tables

  • Thread starter Thread starter kredd
  • Start date Start date
K

kredd

Hello all, i've got an empty table with it's own set of headers. i've got a
second table full of products also with it's own set of headers. they are
totally unrelated. i need to get the data from the second table into the
first table so that i can upload it to my store and populate my inventory.

the data has to be in a very specific order b/c ultimately it will be a comma
delimited file and if the data isn't lined up right the data won't be synced
up once uploaded....with that said, there may be a need for skipping columns
when moving data from the second table to the first. hope that sheds some
light on my situation and made sense...

thanks
 
Would what you call a header be what we would call a field name?

something like:

Tableempty:-
Partno
Description
Quantity
....

and you want to load it with some data like:

Tablein:-
Qty
Desc
Item
.....

So that when you say "Totally unrelated" you just mean that similar things
have different "headers".

If that is the situation an append query will be able to put the right data
into the right place.

If that is not the situation, and nobody else figures it out better than I
could please post again with more information.
 
kredd said:
Hello all, i've got an empty table with it's own set of headers. i've got a
second table full of products also with it's own set of headers. they are
totally unrelated. i need to get the data from the second table into the
first table so that i can upload it to my store and populate my inventory.

the data has to be in a very specific order b/c ultimately it will be a comma
delimited file and if the data isn't lined up right the data won't be synced
up once uploaded....with that said, there may be a need for skipping columns
when moving data from the second table to the first. hope that sheds some
light on my situation and made sense...

thanks

Why not just create a query that filters and orders the records as you
want them, instead of trying to populate a duplicate table?

What purpose does the duplicate table serve that a query wouldn't fulfill?
 
Hello all, i've got an empty table with it's own set of headers. i've got a
second table full of products also with it's own set of headers. they are
totally unrelated. i need to get the data from the second table into the
first table so that i can upload it to my store and populate my inventory.

the data has to be in a very specific order b/c ultimately it will be a comma
delimited file and if the data isn't lined up right the data won't be synced
up once uploaded....with that said, there may be a need for skipping columns
when moving data from the second table to the first. hope that sheds some
light on my situation and made sense...

thanks

It sounds like you want an Append query. You can append any field in a
source table into any field in a target table.

HOWEVER... you should be aware that it is emphatically *not* necessary
to have data lined up with fields and records in a particular order in
a Table in order to export it to a comma delimited text file! In fact,
that's not a good way to go. You can create a Query based on your
(product) table; select whichever fields you want in whichever order
you want; alias the fieldnames if you wish; sort the records into
whatever order you wish... and export *that query* to your comma
delimited file.

John W. Vinson[MVP]
 
Hey guys thanks for the replies...

@david:
you are correct. what i am calling headers are in fact field names. and by
totally unrelated i mean that there is no related data or field names to use
in a query to pull the two tables together. my query knowledge is rather
limited. is what you call an "append" query a specific type? i'll research
that.

@smartin:
the second table isn't a duplicate. the second table holds the data from my
distributor...they have their own field names. the first table is from my
store, which has it's own different field names. so i'm not trying to
duplicate the table i'm trying get data from my distributor table into the
store table with the correct field names so that my store can use it.

for example, the table from my distributor has a field name called "vendor".
the table from my store has a field name called "supplier". i need to get the
data from the "vendor" field into the "supplier" field in the first table.
 
thanks john, that sounds like exactly what i need. i'll go see what i can
find.

John said:
Hello all, i've got an empty table with it's own set of headers. i've got a
second table full of products also with it's own set of headers. they are
[quoted text clipped - 8 lines]

It sounds like you want an Append query. You can append any field in a
source table into any field in a target table.

HOWEVER... you should be aware that it is emphatically *not* necessary
to have data lined up with fields and records in a particular order in
a Table in order to export it to a comma delimited text file! In fact,
that's not a good way to go. You can create a Query based on your
(product) table; select whichever fields you want in whichever order
you want; alias the fieldnames if you wish; sort the records into
whatever order you wish... and export *that query* to your comma
delimited file.

John W. Vinson[MVP]
 
The same thing can have different names. Saying that they are "unrelated"
because the name is different is confusing. In your case
"vendor" is definitely related to "supplier".

Append means add on to the end of, an Append query adds new records.
start in the design window
add your input table to the query
click on the append query symbol
it will ask you for the table that you wish to append to. enter it.
You put the name of the from field into the grid.
In the append to: row in the query design window put the corresponding name
of the field in the new table.
repeat for all fields.
 
well it's related in human terms but not database terms...there is no primary
keys or anythingto pull the data together using a regular query/sql...but
thank for suggesting the Append query...worked great and i got it set up in
mere seconds.
The same thing can have different names. Saying that they are "unrelated"
because the name is different is confusing. In your case
"vendor" is definitely related to "supplier".

Append means add on to the end of, an Append query adds new records.
start in the design window
add your input table to the query
click on the append query symbol
it will ask you for the table that you wish to append to. enter it.
You put the name of the from field into the grid.
In the append to: row in the query design window put the corresponding name
of the field in the new table.
repeat for all fields.
Hey guys thanks for the replies...
[quoted text clipped - 36 lines]
 
Back
Top