sql quetion

  • Thread starter Thread starter O S
  • Start date Start date
O

O S

I need help with the following problem in Access:

I have two tables:

Table 1

Plant code| Department code| Sum 1





Table 2

Plant code| Department code| Sum 2





From these 2 tables I have to create a third table:

Table 3

Plant code| Department code| Sum 1| Sum 2





Thanks for assistance.
 
SELECT [Table 1].*, [Table 2].[Sum 2]
FROM [Table 1] INNER JOIN [Table 2]
ON [Table 1].[Plant code] = [Table 2].[Plant code]
AND [Table 1].[Departement code] = [Table 2].[Department code]

If that gets you the result you want, then turn it into a Make Table query.

--
John Viescas, author
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
http://www.deanforamerica.com/site/TR?pg=personal&fr_id=1090&px=1434411
 
Back
Top