29. september 2003 - 21:09Der er
19 kommentarer og 1 løsning
Hjælp til, at samle alle data i en tabel
Jeg arbejder i en telemarketingsafdeling hvor vi har et system til at registere når vi ringer ud på de enkelte emner. Der er op til 8 mennesker på hver projekt og de har hver deres tabel, foresp. samt formular.De hedder feks. kunde 1, kunde 2, kunde 3 osv. Tabeller, forsp. og formularene er fuldstædig identisk blot med et andet navn. Nu vil jeg gerne samle daten fra de 3-8 tabeller i en er dette mulig og hvordan gør jeg...
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
maria>IF you have other related tables then this could be a problem with Primary/foreign keys. But if all your eggs are in one basket then you COULD try making a UNION query. This will show ALL records from the tables you include. Then you can make a new EMPTY table which has the same layout as the originals. Then you make an append query taking the result of your UNION query and appending it to your NEW table!
when you say "stå under hinanden" a UNION join will show records under each other!
Do you use the primary key as a relationship to other tables? If you do NOT then you dont need to include this in the UNION select. Then when you append them to the new table all records will get a new primary key!
you now have to include the fields because you must NOT include kontakt-id!
SELECT fld1, fld2, fld3 ....... FROM [Kunde 1] UNION SELECT fld1, fld2, fld3 ....... FROM [Kunde 2] UNION .....
If you right click on the are where you normally add your tables yiu get a menu where you can choose SQL specific and then UNION. If you select union you will now be in SQL view where you can directly enter the SQL for the union query
It looks the same as if you had selected all records from one table and then all records from another table on top of each other, not beside each other.
If there are 20 columns in the tables then there will be 20 columns in the result, ready to copy to your NEW table (with 21) columns. And if yiu are still awake NOTICE I write 21! the first column is your autonumber which you do NOT append to as this gets done automatically!
ok jeg har fundet ud af det - jeg er bare lidt små dum;-) - Jeg har lavet den både som en tilførelsesforsp. og som du beskrev.. Men med dit eks. ved jeg ikke helt hvordan jeg får dataen over i en ny tabel!!
You now have a UNION query which selects records from all of your tables. You should also have a new table with the same structure as your original tables. Now make a new query and choose the UNION query as the source. (from the list of tables and queries).
Now you need to alter the query to an append query. In the menu there is a little arrow pointing down. You can choose the type of query here, choose append query, and then choose the table you want to append to.
Now using the mouse you mark ALL fields (not the *) in the table and drag them over to the rows and columns area of the query. You should now see that the row named "Field:" contains all of the row names from the table, and because the names of the fields in the new table are the same then the row named "Append To:" will have the same name.
Then save the query, and you are ready to try it :o) Hope that helps.
Maria, what are you expecting it to do? This is what you asked for isnt it? "Nu vil jeg gerne samle daten fra de 3-8 tabeller i en" and once you have run the append query ONCE then it is done!!!!
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.