Comparing tables and updating

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am looking for a simple way to accomplish this from code:

Concept:

Do until NewRecords table reaches End of File
{
Read in next NewRecords table record
If CurrentVersion field in record is NOT NULL
{
IF NewRecords!ObjPath field matches any ParsedResults!ObjPath field
{
Delete that record from ParsedResults table
}
Add NewRecords record to ParsedResults table
}
Next Record
}
Scan ParsedResults for duplicate SerialNumber and deleted oldest record
(Date_Time)

Any help appreciated!
 
Easiest would be to create a Delete query that deletes all rows from
ParsedResults where ObjPath = NewRecords!ObjPath and
NewRecords!CurrentVersion Is Not Null, and then an Append query that appends
all of the rows from NewRecords table where NewRecords!CurrentVersion Is Not
Null.

Using SQL is almost always better than using VBA to do the same task.
 
Back
Top