473,396 Members | 1,992 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.

Comparing tables in MS Access

Hi,

I am not really familiar with MS ACCESS. However, I am trying to make
some reports where you compare current data from a table with old data
from the same table. What I'm saying is we have a database with
current data, and the same database with old data.

I need to create reports for new rows inserted, deleted rows, and
updates rows. I'm having trouble figuring how to query which rows
have been updated (meaning the primary key(s) are the same, but other
attributes of the row have been modified).

Can someone please help?

Bung
Nov 13 '05 #1
2 4179
bu**@telusplanet.net (Bung) wrote in message news:<b8*************************@posting.google.c om>...
Hi,

I am not really familiar with MS ACCESS. However, I am trying to make
some reports where you compare current data from a table with old data
from the same table. What I'm saying is we have a database with
current data, and the same database with old data.

I need to create reports for new rows inserted, deleted rows, and
updates rows. I'm having trouble figuring how to query which rows
have been updated (meaning the primary key(s) are the same, but other
attributes of the row have been modified).

Can someone please help?

Bung


Short answer: you can't. There's no transaction log in Access like
there is in SQL server. You can force your users to modify data
through a form and then use form events to log the changes. See Allen
Browne's AuditLog code on his website.
Nov 13 '05 #2
Bung ,
Without the specifics try this:
Table 1
id, field2, field3

Table 2
id, field2, field3
create a query using the Query Builder, use both tables and link them
together by ID. (I assume you know how to do this bit), select field2
and field3 from Table 1 and drop them into the fields area of the
query builder.
in the first row of the criteria on field2 type:
<>[Table 2].field2
on the next row of the criteria on field3 type:
<>[table 2].field3

repeat this process for each field moving to the next row of the
criteria.

This creates the following sql

SELECT [Table 1].id, [Table 1].field2, [Table 1].field3
FROM [Table 1] INNER JOIN [Table 2] ON [Table 1].id = [Table 2].id
WHERE ((([Table 1].field2)<>[Table 2].[field2])) OR ((([Table
1].field3)<>[Table 2].[field3]));
To see how this works, try creating two tables (Table 1 and Table 2)
with the three fields and make the values in the non key fields
different. Run the query and see what happens. Try adding a field to
each table and adding them to the query. You should see how you can
do this for as many fields as you need.

Hope this helps

:)

bu**@telusplanet.net (Bung) wrote in message news:<b8*************************@posting.google.c om>...
Hi,

I am not really familiar with MS ACCESS. However, I am trying to make
some reports where you compare current data from a table with old data
from the same table. What I'm saying is we have a database with
current data, and the same database with old data.

I need to create reports for new rows inserted, deleted rows, and
updates rows. I'm having trouble figuring how to query which rows
have been updated (meaning the primary key(s) are the same, but other
attributes of the row have been modified).

Can someone please help?

Bung

Nov 13 '05 #3

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

Similar topics

4
by: osmethod | last post by:
Hello, I have read many articles about comparing tables, like - loops, delete queries, appending to temp table with index etc Problem: 2 tables T1 & T2. Data is suppposed to be the same in...
1
by: ABinBoston | last post by:
I was uaing some code derived from the Northwind database to relimk tables at startup. The code works well in accerss 97/2000, but does not in 2003 Does anyone have any references to a...
2
by: cmcmillan | last post by:
Hello folks. I have a database with about 10 users. On startup of the front end (Which holds some tables, macros, forms) I am running a macro that deletes a couple tables and imports replacements...
7
by: smd | last post by:
Hello and thanks for taking the time to read this. I've looked all over the web and newsgroups and can't find a solution to my problem. I've posted this question to the Access 2000 group as well -...
1
by: Jerome Ranch | last post by:
I consider myself an Excel PT wizard of sorts, but now I have a situation with so much infromationthat I need to categorize and summarize, that I will use access to manage it. Interestingly,...
2
by: Wayne | last post by:
We have a query which compares each field in two tables (let's say Table1 and Table2) and identifies any records that have been modified. For example, one of these columns looks like: Field: ...
1
by: razaqtelecom | last post by:
Hi, I want to know how can i write a stored procedure for the following sceario. Take if there are three tables, table1, table2, table3 and table1 is linked with table2 and table 2 is linked...
1
by: ckmoied | last post by:
Hi, Can I have a script to compare the two tables. Such that I can identify the missing rows of Table A in Table B, in the absece of any know key.
4
by: xperre van wilrijk | last post by:
Hi, I have inherited an access userinterface that links to sql server tables through ODBC. The SQL server database contains data related to villages in my country and is populated by my...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.