472,348 Members | 2,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,348 software developers and data experts.

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 3087
ADezii
8,832 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

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

Similar topics

1
by: GitarJake | last post by:
Hello all, I am new to sql and have some Access experience. In sql, how do I: compare 2 identical tables, (except for data); then update table...
4
by: Maur | last post by:
Hi all, I have 2 tables say t_OLD and t_NEW. The new has corrections for audit purposes. They are identical in all respects (i.e. new is a...
5
by: Megan | last post by:
Hi everybody- I'm helping a friend with a music database. She has an old one and is creating a new one. She wants to compare records and fields...
1
by: Stephen | last post by:
I am trying to compare the tables in two similar databases using the SQLDMO object. I am able to use this object to access different SQL servers and...
3
by: Kiran B. | last post by:
Hi, I am new to .net. I have two Data Structure Type ... Sturcture A and Structure B. Structure A Public Fname as String Public LastName as...
50
by: titan nyquist | last post by:
I wish to compare two structs via == but it does not compile. I can overload and create my own == but am I missing something that c# already has...
3
by: =?Utf-8?B?UmljY2FyZG8=?= | last post by:
What is the best method to compare 2 array to knw if each element is equal? Now, i have to compare the datarow.itemarray of 2 datarows wich is...
2
by: Ecohouse | last post by:
I'm using Access 2003 and will have to separate databases with the exact same tables and table structures. I need to be able to compare the table...
26
by: neha_chhatre | last post by:
can anybody tell me how to compare two float values say for example t and check are two variables declared float how to compare t and check...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.