Group:  Microsoft Access ยป microsoft.public.access.reports
Thread: Conversion of 4 tables in one

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Conversion of 4 tables in one
"Ixak" <ixak81[ at ]yahoo.es> 16.09.2006 12:40:07
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


Re: Conversion of 4 tables in one
"Jeff Boyce" <JeffBoyce_IF[ at ]msn.com-DISCARD_HYPHEN_TO_END> 16.09.2006 16:24:25
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
http://mvp.support.microsoft.com/

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

Microsoft Registered Partner
https://partner.microsoft.com/


"Ixak" <ixak81[ at ]yahoo.es> wrote in message
news:OLbwB1Y2GHA.1288[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> 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
>
>

Re: Conversion of 4 tables in one
"Douglas J. Steele" <NOSPAM_djsteele[ at ]NOSPAM_canada.com> 16.09.2006 18:16:09
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

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)


"Ixak" <ixak81[ at ]yahoo.es> wrote in message
news:OLbwB1Y2GHA.1288[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> 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
>


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net