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

How to compare 2 tables to update price and to find extra parts in either table

2
Table1
Part_name
Price

Table2
Part_name
Price

Table1 may have part numbers that are not in Table2
Table2 may not have part numbers that are in Table1
For the parts that are the same, I need to compare prices

I want to return a new table that shows
Parts in table 1 that are not in table 2
Parts in table 2 that are not in table 1
Prices that are not equal for matching part numbers

These tables have matching field names, part numbers, price etc.

Any help is appreciated, I am comparing over 1000 records
Aug 10 '16 #1
2 783
nico5038
3,080 Expert 2GB
I would use a UNION query with:
Expand|Select|Wrap|Line Numbers
  1. Select part, price as price1, 0 as price2 from tblOne
  2. UNION
  3. select part, 0 as price1, price as Price2
Next I would create a Group By query on this UNION to get the MAX() of the Price1 and Price2 field per part.
This will give all info and allows you to exclude the rows with Price1 = Price2, thus having one table with the culprit.

Getting the idea?

Nic;o)
Aug 11 '16 #2
Wbfuga
2
Not sure, I will keep trying
thank you for the help.
Aug 12 '16 #3

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

Similar topics

0
by: cwbp17 | last post by:
Have a datagrid that displays the price column in this format $12,400.00 from a table. Went to the Property Builder of the datagrid and selected the Price column and changed the Data formatting...
2
by: Jeff | last post by:
Is there a way I can compare two tables. I'm attempting to make certain that the data in table 1, exactly matches the data in table 2. Thanks Jeff
1
by: Prakash RudraRaju | last post by:
Hi, I have recently migrated MSAccess Tables (nearly 120) to MySQL. To test successful migration I want to compare all tables. I have linked MySQL tables through ODBC connection. I want to...
4
by: dfs9 | last post by:
In the article "Delete Duplicate Records From Access Tables" By Danny Lesandrini writes the following: This final suggestion is the most flexible and accurate. Given any table, it generates a...
2
by: sleepyant | last post by:
Hi, I have 2 identical tables in each server that I need to compare and update/insert accordingly using SQL. For example, server A as a source and Server B as destination which both have Table1....
6
by: Bob Alston | last post by:
I have an Access software app installed in 8 locations. Updates are becomming very time consuming. Updating everything but the tables in the backend is quite easy. The difficult part is...
5
by: Edd E | last post by:
Hi, I have a database to store my analyses (Access 2002, WinXp), the basic structure is: TABLE 1 = Sample Info TABLE 2 = Analysis type 1 TABLE 3 = Analysis type 2 TABLE 4 = Analysis type 3 ...
7
by: Deano | last post by:
Got a bit of a major task coming up - I need to migrate data from one version of my mdb to another. Normally I manually track what's changed but there have been so many alterations it's been...
0
by: rsyCoder | last post by:
I have a file from a vendor in XML: <Item> <company>Stuff</company> <UPC>876543210123</UPC> <prod_cd>M-PRODUCT </prod_cd> <descrip>This thing has some describable charicteristics...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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,...

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.