On Wed, 29 Jun 2005 11:32:04 -0700, "Danny"
<(E-Mail Removed)> wrote:
>I have 2 tables with the same numbers of fields and same name
>Table 1 is the original data and
>Table 2 is the adjustments data, which needs to be kept seperate
>
>I am having trouble combining data from both tables. In some instances there
>is data in table 2 but not in table one
>
>eg account number may be in t2 not not in t1
>I have considered using a junction table but this does not work
>Other than the ID in both tables there are no other primary keys
>
>Fields are
>
>ID
>Company Code (duplicate YES)
>Account (duplictaes YES)
>Value 1
>value 2
>Text
>
>Can some help and suggest ways of improving or meths that I can use to
>return data say based on both Company code and account numbers.
Sounds like you need a UNION query:
SELECT ID, [Company Code], [Account], [Value 1], [Value 2], [Text]
FROM T1
UNION ALL
SELECT ID, [Company Code], [Account], [Value 1], [Value 2], [Text]
FROM T2
ORDER BY <whatever makes sense for your needs>
John W. Vinson[MVP]
|