473,396 Members | 1,997 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,396 software developers and data experts.

Compare 2 tables and only show the changes in result sheet

Please can anybody help me with the following:

I have two separate excel spreadsheets that I have imported into
access, each sheet holds the same fields. Both spreadsheets hold all
information for employees however, they are from two different dates
so by comparing both sheets I should to be able to check which records
DO NOT match.

From the records that DO NOT match I need to locate the information
that has changed. But I only want to bring in the fields that have
changed, so for example 1:

Spreadsheet1 - ID No:12345 DOB 28/02/78 Grade A Department Finance
Hours 37
Spreadsheet2 - ID No:12345 DOB 28/02/78 Grade B Department HR Hours
37

Result of query = ID No: 12345 DOB (blank)Grade B Department HR Hours
(blank)

Example 2:

Spreadsheet1 - ID No:56789 DOB 28/09/82 Grade B Department HR Hours
37
Spreadsheet2 - ID No:56789 DOB 28/09/82 Grade BS Department HR Hours
25

Result of query = ID No: 56789 DOB (blank)Grade BS Department
(blank)Hours 25

Any help would be a great help, thankyou in advance - I only know
access at intermediate level, so I have attempted to compare these
tables using following formula:

iif(Table1.DOB = Table2.DOB, true, false

But all this does is bring me back all records and displays -1 in the
columns where ive used the formula above - think a union query might
help but have no idea how to do this.

Please help

Rachel
Nov 13 '05 #1
1 2319
cu***********@hotmail.com (Rachel Curran) wrote in message news:<f1**************************@posting.google. com>...
Please can anybody help me with the following:

I have two separate excel spreadsheets that I have imported into
access, each sheet holds the same fields. Both spreadsheets hold all
information for employees however, they are from two different dates
so by comparing both sheets I should to be able to check which records
DO NOT match.

From the records that DO NOT match I need to locate the information
that has changed. But I only want to bring in the fields that have
changed, so for example 1:

Spreadsheet1 - ID No:12345 DOB 28/02/78 Grade A Department Finance
Hours 37
Spreadsheet2 - ID No:12345 DOB 28/02/78 Grade B Department HR Hours
37

Result of query = ID No: 12345 DOB (blank)Grade B Department HR Hours
(blank)

Example 2:

Spreadsheet1 - ID No:56789 DOB 28/09/82 Grade B Department HR Hours
37
Spreadsheet2 - ID No:56789 DOB 28/09/82 Grade BS Department HR Hours
25

Result of query = ID No: 56789 DOB (blank)Grade BS Department
(blank)Hours 25

Any help would be a great help, thankyou in advance - I only know
access at intermediate level, so I have attempted to compare these
tables using following formula:

iif(Table1.DOB = Table2.DOB, true, false

But all this does is bring me back all records and displays -1 in the
columns where ive used the formula above - think a union query might
help but have no idea how to do this.

Please help

Rachel


Try the following query:

SELECT 'ID No: ' & CStr(Table1.ID) & ' DOB: ' &
IIf([Table1].[DOB]<>[Table2].[DOB], Table2.DOB,'(blank)') & 'Grade: '
& IIf([Table1].[Grade]<>[Table2].[Grade] , Table2.Grade,'(blank)') & '
Department: ' & IIf([Table1].[Department]<>[Table2].[Department],
Table2.Department,'(blank)') & ' Hours: ' &
IIf([Table1].[Hours]<>[Table2].[Hours], Table2.Hours,'(blank)') As
Output FROM Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID WHERE
(((Table1.DOB)<> Table2].[DOB])) OR
(((Table1.Grade)<>[Table2].[Grade])) OR
(((Table1.Department)<>[Table2].[Department])) OR (((Table1.Hours) <>
[Table2].Hours));

James A. Fortune
Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: lkrubner | last post by:
I have a webserver through Rackspace. I create a domain. I create an FTP user. I upload some files. I create a database called testOfSetupScript and then I create a database user named setup. I...
2
by: Rachel Curran | last post by:
Please can anybody help me with the following: I have two separate excel spreadsheets that I have imported into access, each sheet holds the same fields. Both spreadsheets hold all information...
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...
8
by: Vincent | last post by:
has any one seen a program to compare mdbs'. I have ran into a few of them, but none seem to really do that job. Basically what I need to do is, take 2 access mdb's and check the differences...
1
by: Mr. B | last post by:
VB.net 2003 c/w Framework 1.1 and MS Access db We have a commercial program that does our Acounting and Time Sheets (Timberline). At least once a day our Accounting department runs a Script...
2
by: Eero Tuomenoksa | last post by:
Hi Does someone knows how i can show/hide multible divs at one click? -- Käytössä Operan vallankumouksellinen sähköpostiohjelma: http://www.opera.com/mail/
4
by: Mike | last post by:
I encountered this problem for the first time today while trying to add some columns to a query from a linked DBASEIII file. The new columns that I added on the design grid do not show up on the...
25
by: bubbles | last post by:
Using Access 2003 front-end, with SQL Server 2005 backend. I need to make the front-end application automatically refresh the linked SQL Server tables. New tables will be added dynamically in...
6
by: napatel04 | last post by:
Hi everyone, I would like to know if there is a quick query someone can help me write for the following scenario. I think I can do this with VBA but since this is suppose to be a temp. solution,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.