469,354 Members | 2,198 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,354 developers. It's quick & easy.

Compare identical table structures for different values

7
Hi,

Is there any way to compare two identical table structures in access for different values in them.
EG:
Table 1:
Name occupation
rob plumber

Table 2:
Name occupation
rob builder

Is there any way this can be done in a query ?
Also how can a select query be written in vba for say table one in the above example?
Jun 26 '07 #1
3 2857
ADezii
8,800 Expert 8TB
Hi,

Is there any way to compare two identical table structures in access for different values in them.
EG:
Table 1:
Name occupation
rob plumber

Table 2:
Name occupation
rob builder

Is there any way this can be done in a query ?
Also how can a select query be written in vba for say table one in the above example?
The following SQL Statement will return the Name, Occupation in Table 1, and all Occupations in Table 2 that do not match the Occupation in Table 1 for the same individual. Is this what you want?
Expand|Select|Wrap|Line Numbers
  1. SELECT [Table 1].Name, [Table 1].Occupation, [Table 2].Occupation
  2. FROM [Table 1] INNER JOIN [Table 2] ON [Table 1].Name = [Table 2].Name
  3. WHERE [Table 2].Occupation<>[Table 1].[Occupation];
Jun 26 '07 #2
ago
7
The following SQL Statement will return the Name, Occupation in Table 1, and all Occupations in Table 2 that do not match the Occupation in Table 1 for the same individual. Is this what you want?
Expand|Select|Wrap|Line Numbers
  1. SELECT [Table 1].Name, [Table 1].Occupation, [Table 2].Occupation
  2. FROM [Table 1] INNER JOIN [Table 2] ON [Table 1].Name = [Table 2].Name
  3. WHERE [Table 2].Occupation<>[Table 1].[Occupation];
Yes. This does work fine. Just to add to it if I use <>Nz it will also compare the fields that are null right ?
Jul 26 '07 #3
missinglinq
3,532 Expert 2GB
I've changed the title of your post to make the subject matter clearer to members on the forum now, as well as people who may use the Search function in the future researching similar problems. Since you are a new member of the forum, please take the time to read the Posting Guidelines, paying particular attention to the section "Give a clear title to your question."

(POSTING GUIDELINES: Please read carefully before posting to a forum)

Welcome to TheScripts!

Linq ;0)>
Jul 26 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by GitarJake | last post: by
1 post views Thread by Stephen | last post: by
3 posts views Thread by Kiran B. | last post: by
50 posts views Thread by titan nyquist | last post: by
3 posts views Thread by =?Utf-8?B?UmljY2FyZG8=?= | last post: by
26 posts views Thread by neha_chhatre | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.