17. juni 2005 - 15:06Der er
10 kommentarer og 2 løsninger
Finde forskeld
Jeg modtager hver uge nogle tabeller med data. For tiden må jeg side manuelt og se om der er en forskeld imellem den forrige uge og den nye, om der er nye rækker eller om der er nogle der er forsvundet.
Jeg regnede me at jeg kan smide det i en Database og få den til at vise mig forskelden, men jeg ved ikke hvordan jeg skal lave det.
Ja men skal jeg så oprette en tabell for hver uge? det lyder jo ikke særligt smart, da jeg får ny dataer hver uge. Og jeg skal ikke finde dem der er ens. Jeg skal finde dem der er nye, og dem der er forsvundet, og få dem presenteret.
no there isnt any easy method for doing this. But a little more information might help!
You say "nogle tabeller". Do you mean a number of tables or one table for each week?
Is there a primary key which can be used to find already existing records and missing records? Dou you also want to see records which have changed and if so, how many fields need to be compared?
To Clarify a bit. I receive 1 table per week, but with hundreds of Records, Each record does not have an Identifier, but the collected fields in the record makes each row Unique, so I can use those fields as a Primary Key. It has 2 fields that identifies the Row uniqly. [PE], [Interface] I can use those fields as a Primary key. However, I saw a problem with that, If next week I get a new bunch of records, and import those to the same table, I will have conflicts, with duplicated keys, since a lot of the records will be same as previous week.
Hope this clarifies a bit. The only solution I could se was to Use Excel and do a VB code that checks every entry and runs it through all the records, but I figured there must be an easier way.
If all fields in a record make up the primary key then all that you can do is INSERT records which do not already exist.
Try importing all records into a TEMP table which has the same layout as the original table. Then make an APPEND query whcih takes the records from the TEMp and INSERTs them into the original. If ALL fields make up the primary key then only records whcih do not already exist will get APPENDed to the table.
thanks, drop a comment if you still need help when you get around to lookin at it
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.