You need to store the data otherwise you'll lose it. You'll use a query to group the data to what you want.
SELECT ColumnA, ColumnB, MIN(Reason Code)
FROM table1
GROUP BY ColumnA, ColumnB
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Looking for some advice on handling a table. I’ve got an Access mdb database. The VB program that drives it puts data into two columns of a table, and for each row it puts a numeric reason code in the third column. The data pairs in the first two columns may be duplicated many times, but each occurrence will have a unique reason code. I need to end up with a single row for each data pair (sorted by column A/column B), with only the lowest reason code remaining.
For example, the program may write the data in the following order:
Column A
Column B`` ``Reason Code
aaa bbb 4
aaa bbb 2
bbb ccc 1
bbb ccc 3
aaa bbb 0
The result I need is:
Column A
Column B`` ``Reason Code
aaa bbb 0
bbb ccc 1
Can the table be defined so that the table automatically ends up in the order I need? Or do I need to populate the table first, then use a query to sort the rows and eliminate the duplicates?
You need to store the data otherwise you'll lose it. You'll use a query to group the data to what you want.
SELECT ColumnA, ColumnB, MIN(Reason Code)
FROM table1
GROUP BY ColumnA, ColumnB