Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to identify new records

Status
Not open for further replies.

icoxy

Technical User
Apr 20, 2007
11
GB
Hi,

I have a table that is updated from an excel import.

The problem is to identify any new records that have been added since the last update. It is easy to identify records that have the same key value, but how do you identify the new ones?

Thanks

Ian
 
Have you a DateTime field with DefaultValue set to =Now() ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,

It would be good if I had, but unfortuneately I have no control over the source data.

The table has an autonumber ID with related data in other tables, so I can't do a complete new import or I would create orphan records in the other tables.

I could loop through the new and old tables for items that don't match, but I seem to remember that this can be done using access - rather than code.

Any ideas?

Thanks,

Ian
 
I may be wrong, but I think PHV may have been asking if you have the DateTime field as part of the table the records are being added to. If so (or if added), the newly added records will have the current date and time automatically put into that field.

Let them hate - so long as they fear... Lucius Accius
 
this will only work before you do the import, so don't know if it's feasable to setup a temp table to import into, and the process the data from the temp table...

anyway...

Select * from Table1 where Table1.PK not in (
select Table2.PK from Table2
)

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top