Conversion of 4 tables in one

  • Thread starter Thread starter Ixak
  • Start date Start date
I

Ixak

Hello
I would like to modify the design of my database and convert 4 different
tables whose only difference is the main code, the rest of the fields are
the same, in one table.I mean;

Code_man
product
color
design

Code_woman
product
color
design

And convert in

Code
sex: woman/man
product
color
design

Is there any special method instead of doing it manually?
thanks
 
I'm not sure how you mean "manually".

If I were doing this, I'd create my new table first. Then I'd create a
query against the first-to-be-converted table, returning all rows. I'd add
a field containing the, as you put it, "main code", then change the query to
an append query. Access asks "append to which table?", to which I'd answer
my new table.

Repeat until all have been appended (i.e., converted).

If you are only going to do this a single time, it won't save you any
time/energy to create a function/routine to automate this.

If you need to do it repeatedly, consider creating a function that calls the
append queries (or use a macro to run them).

--
Regards

Jeff Boyce
Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/

Microsoft Registered Partner
https://partner.microsoft.com/
 
You could try creating a Union query first. For your example, you'd use

SELECT "man" AS sex, product, color, design
FROM Code_man
UNION
SELECT "woman" AS sex, product, color, design
FROM Code_woman
 
Back
Top