Avatar billede clausnilsson Mester
02. juni 2020 - 19:50 Der er 8 kommentarer og
1 løsning

Relationer til importeret tabel Access 365

Jeg har en csv-fil som ekstern datakilde. Csv-filen genereres af et lille program semiautomatisk og så opdateres datakilden løbende. Der er et felt som er unikt samt tre andre felter. Jeg skal nu tilføje sammensatte felter og manuelt indtastede felter til hver post. Men jeg kan ikke gennemskue hvordan jeg laver en-til-en relationer til en importeret tabel, og jeg kan ikke finde en løsning, har googlet det længe nu.

Så lad os antage der er 100 poster i tabel A nu. I en anden tabel B med 1-til-1 relationer skal jeg have flere felter til hver post i tabel A. Så i morgen kommer der 5 nye poster i tabel A. Så mangler der data på disse 5 nye poster i tabel B. Jeg tænker det skal være en forespørgsel som finder de 5 nye poster så jeg tilføje data til tabel B.

Det er måske et løst funderet spørgsmål, men jeg kan ikke udtænke andre detaljer at tilføje pt. Hvis nogen forstår problematikken på dette grundlag hører jeg gerne om en løsning. Hvis det er helt sort svarer jeg hjertens gerne på spørgsmål, som jeg så ikke på forhånd fået øje på. Kan også være jeg griber det helt forkert an?
Avatar billede terry Ekspert
02. juni 2020 - 21:42 #1
"Så mangler der data på disse 5 nye poster i tabel B. Jeg tænker det skal være en forespørgsel som finder de 5 nye poster så jeg tilføje data til tabel B"

How is the data in table B related to the data in table A?
Avatar billede clausnilsson Mester
03. juni 2020 - 08:49 #2
Well, maybe the problem is that there is no relation between A and B, they should actually be the same table. Problem is that only three of the fields are harvested by the external program and the rest are calculated or input manually.
Avatar billede terry Ekspert
03. juni 2020 - 09:01 #3
"....they should actually be the same table."
Cant you have a table with all fields and then import the csv into that table. Then you dont need the relationship.
Avatar billede terry Ekspert
03. juni 2020 - 09:12 #4
You mentioned that the fields in table B are either calculated or manually entered.
So the only field in table B which has an relationship to A is the primary key.

It shouldnt be a problem to find those in A and not in B and create those missing, and also add the calcualted fields.
Avatar billede clausnilsson Mester
03. juni 2020 - 09:25 #5
I see your point, I think. So the harvested data with 3 fields can be added to an existing table with say 8 fields, and then the 5 additional fields must be calculated or entered after. Did not know that was possible. Is that what you are saying?
Avatar billede terry Ekspert
03. juni 2020 - 10:55 #6
Yes its possible to have a table with 8 fields in and only import the first 3 fields into that table.
How are you importing the csv at the moment?
Avatar billede clausnilsson Mester
03. juni 2020 - 11:02 #7
I tried making a connection to the csv file, which was good, because it would automatically be updated. But with your suggestion I would probably need to do a clean import and then add the new records to the old table?
Avatar billede terry Ekspert
03. juni 2020 - 11:19 #8
I would suggest that you import the csv into an access table. You can start by importing into a new table to create the table. Then modify it to add other fields which would be in table B.
Then when you import again you can import to the existing table.
Avatar billede terry Ekspert
03. juni 2020 - 12:38 #9
Hope you got it to work OK...
Avatar billede Ny bruger Nybegynder

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.

Loading billede Opret Preview

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester