473,388 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 3210
ADezii
8,834 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 1 with new data from table 2 TIA Jake
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 copy of old and then changes are made to t_new) ...
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 in the old database with records and fields in the...
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 choose two different databases. The versions of...
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 String Public City as String Public Zip as String...
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 implemented? ~titan
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 equals in structure. I tried to write this routine:...
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 from the second database against the same 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 please help me as soon as possible
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.