473,396 Members | 1,975 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 & then joining 2 tables in ms-access

I've original version of a table called PMM (Product Material Master).
Thro' a web interface, user can change that table contents. Once
changed, i need to raise an ECN (Engineering CHange Note) specifying
what changes happened to original PMM table whether rows are deleted,
new rows are added or existing rows are modified etc. I've both old and
new version of PMM tables.

The difference between two PMM tables are captured in a third table
called ECN and it has both original & new PMM table entries which are
not same.
PMM Table structure is as follows.

SbPartNo char(50)
PartDesc char(200)
manPartNo char(200)
manufacturer char(100)
vendor char(100)
refDesi char(200)
qty char(5)

My requirement is as follows:

table 1 (original version of PMM table)

1111 partDesc1 111111 xyz1 vendor1 refdesi1 2
2222 partDesc2 222222 xyz2 vendor2 refdesi2 4
3333 partDesc3 333333 xyz3 vendor3 refdesi3 6

table 2 (Modified version of PMM table)

2222 partDesc2 222222 xyz2 vendor2 refdesi2 4
3333 partDesc3 343434 xyz3 vendor3 refdesi3 6
4444 partDesc4 444444 xyz4 vendor4 refDesi4 8
ECN Table structure is as follows:

old_SbPartNo char(50)
old_PartDesc char(200)
old_manPartNo char(200)
old_manufacturer char(100)
old_vendor char(100)
old_refDesi char(200)
old_qty char(5)
new_SbPartNo char(50)
new_PartDesc char(200)
new_manPartNo char(200)
new_manufacturer char(100)
new_vendor char(100)
new_refDesi char(200)
new_qty char(5)

After comparing the above 2 PMM tables, join two PMM table's data., i
want the result to be stored in ECN table as follows.

1111 partDesc1 111111 xyz1 vendor1 refdesi1 2 null null null null null
null null (null for new entries b'cozthis row is deleted in new version
ofPMM table)

3333 partDesc3 333333 xyz3 vendor3 refdesi3 6 3333 partDesc3 343434
xyz3 vendor3 refdesi3 6 (this row has entries for both old & new fields
b'coz this row is modified from original one)

null null null null null null null 4444 partDesc4 444444 xyz4 vendor4
refDesi4 8 (this row has old entries as null, bcoz this is a new row of
data that is being added to original PMM table)

The second row of data in original PMM table is not changed. So, we
won't store that in ECN.

I won't mind implementing this logic in multiple queries. If possible,
pls give the complete syntax for the entire query as i'm not much
conversant with sql. This is very urgent as i need to meet the deadline
shortly.

Thank you so much.

Nov 13 '05 #1
0 1663

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

Similar topics

192
by: Kwan Ting | last post by:
The_Sage, I see you've gotten yourself a twin asking for program in comp.lang.c++ . http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&th=45cd1b289c71c33c&rnum=1 If you the oh so mighty...
13
by: PS | last post by:
I want to display the image from database to picture box through ado.net and vb.net I have some images present in a sql server 2000 table stored under 'image' datatype. I want to extract and...
2
by: James | last post by:
Can anyone please shed some light on the following... I have a framework that uses dynamically created tables, named using an incremental "attribute set ID", as follows: attrdata_1 attrdata_2...
0
by: zerobearing2 | last post by:
Hi all- I'm migrating to postgres from the MS SQL Server land, as I can see a great potential with postgres, I was wondering if anyone has experimented or started a project with XML inside user...
4
by: (PeteCresswell) | last post by:
I'm equi-joining two tables on a Long and a DateTime field and then comparing an amount in one with an amount the other via an Immediate If statement. Problem is that for some (not all...not...
1
by: epigram | last post by:
I'd like to know if there is a best approach, in terms of using the Data Web Controls (i.e. DataGrid, DataList & Repeater), for displaying data that is the result of a query that joins two tables...
8
by: Roger | last post by:
Has anyone done this yet? I know it is easily done in Paradox, but I would like to do it in VB.Net. Can anyone point me in the right direction? Thanks, Rog
10
by: Asaf | last post by:
Hi, I am trying to Compress & Decompress a DataSet. When running this code I am receiving the error: System.Xml.XmlException was unhandled Message="Root element is missing."...
4
by: Jane T | last post by:
I appreciate how difficult it is to resolve a problem without all the information but maybe someone has come across a similar problem. I have an 'extract' table which has 1853 rows when I ask for...
0
by: sharsy | last post by:
Hi, I've setup a query that compares the difference (in years) between two date fields (Joining Date & Date Cancelled) and then totals how many people fit into each category (0 years, 1 year, 2...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.