Need to update database

T

twisty1980

Hi hopefully this is a simple question.

I have 2 databases one with my main data and the other with alterations to
the data.
First database
prodID country
1 BR
2 GB
3 US
2nd database
1 null
2 RU
3 US

If the 2nd database is null I need the final tale to contain the value from
the 1st database but if the 2nd database has a value I need it to show that
in the new table.

Have tried for 2 days but I am no closer, any help would be much appreciated

Thanks
 
A

Allen Browne

Okay, you have have 2 databases (2 mdb files, not just 2 tables).

1. In the 2nd database, link the table from the first one:
File | Get External | Link

2. Create a query using both tables: the real one (I'll call Table1), and
the linked one (I'll call Table2.)

3. In the upper pane of query design, drag Table1.ProdID and drop it on
Table2.ProdID. Access joins the 2 tables.

4. Double-click the line joining the 2 tables.
Access opens a dialog with 3 options.
Choose the one that says:
All records from Table1, and any matches from Table2.

5. Drag Table1.ProdID into the grid.

6. In the next column, in the Field row, enter:
CountryOutput: Nz([Table1].[Country], [Table2].[Country])
 
T

twisty1980

Thanks Allen,

Works now

Allen Browne said:
Okay, you have have 2 databases (2 mdb files, not just 2 tables).

1. In the 2nd database, link the table from the first one:
File | Get External | Link

2. Create a query using both tables: the real one (I'll call Table1), and
the linked one (I'll call Table2.)

3. In the upper pane of query design, drag Table1.ProdID and drop it on
Table2.ProdID. Access joins the 2 tables.

4. Double-click the line joining the 2 tables.
Access opens a dialog with 3 options.
Choose the one that says:
All records from Table1, and any matches from Table2.

5. Drag Table1.ProdID into the grid.

6. In the next column, in the Field row, enter:
CountryOutput: Nz([Table1].[Country], [Table2].[Country])

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

twisty1980 said:
Hi hopefully this is a simple question.

I have 2 databases one with my main data and the other with alterations to
the data.
First database
prodID country
1 BR
2 GB
3 US
2nd database
1 null
2 RU
3 US

If the 2nd database is null I need the final tale to contain the value
from
the 1st database but if the 2nd database has a value I need it to show
that
in the new table.

Have tried for 2 days but I am no closer, any help would be much
appreciated
 
Top