简体   繁体   中英

How to compare 2 rows and display the differences?

I have 1 table with dozens of possible combinations "ROWS".

  1. the user will be asked to enter two search terms
  2. after that the query is executed and display the 2 matching rows as results

How can I compare the 2 queried rows and display the differences for each column as an "alternate field"?

How can I make sure the user gets prompted to enter the 2 search terms? The query below works when I enter it as shown, but I can't figure out how to prompt twice:

Select
  [100_Prts].*
From
  [100_Prts]
Where
  ([100_Prts].[T101_PART] = '6-HPB01A') Or
  ([100_Prts].[T101_PART] = '8-H01S7')

This works in Access:

SELECT [100_Prts].*
FROM 100_Prts
WHERE ((([100_Prts].T101_PART)=[Enter Part Number])) OR ((([100_Prts].T101_PART)=[Enter Alternative Part Number]));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM