Avatar billede Newbee1 Novice
23. august 2010 - 14:48 Der er 11 kommentarer og
1 løsning

Sammentælle felter fra 3 krydstabuleringer

Hej

Jeg har oprettet 3 x krydstabuleringer, der hver især tæller
hvor mange gange, et lønnummer fremgår i en tabel.


Jeg skal nu have lavet en foresprøgsel, der laver en ny optælling, hvor det samlet antal gange et lønummer fremgår skal vises.:

Lønummer      antal

123456          2
123457          0      osv.


Er der nogen der kan vise et eksempel ?


MVH

Tony
Avatar billede terry Ekspert
23. august 2010 - 15:24 #1
Avatar billede mugs Novice
23. august 2010 - 17:43 #2
Kan du ikke blot lave en forespørgsel og vise totaler med en gruppering på lønnummer og antal?
Avatar billede Newbee1 Novice
24. august 2010 - 08:37 #3
Hi Terry


Yes worked in tabel with one columm.

Now I have to count the number of dates, in 3 differnent columms.

Every time af date acour, it has to look on the person-id, and count how many times, he shows up.

I have made 3 Krydstabulerings forespørgsel (onr for each columm, each working fine but now I have to, gather them into one ?

I cannot make it work in a normal Qeury or in "krydstabulering".

Regards

Tony
Avatar billede terry Ekspert
24. august 2010 - 09:33 #4
Obviously not having a full understanding of your data or exactly what your trying to do doesnt help.


Why do you have three cross-tab queries, do you also have three tables?


Can you try explaining in more detail so I get a better picture?
Avatar billede Newbee1 Novice
24. august 2010 - 10:05 #5
Hi Terry

I have 2 tables.

1 Lønnummer: medarberjderID, lonnummer, fornavn, efternavn

2 Medarbejder: ID, bemærkning, Medarbejderid1, Medarbejderid2, Medarbejderid3, Dato, Oprettet af, Oprettet tid.

I have to count how many times each employee, figures in
Medarbejderid1, Medarbejderid2, Medarbejderid3.

I have made 3 cross-tab queries, each counting how many in each
colomm, so now i have to get the total for each employee.

Regards

Tony
Avatar billede terry Ekspert
24. august 2010 - 10:08 #6
how are the tables related and why 3 medarb.ids in same record?
Avatar billede Newbee1 Novice
24. august 2010 - 10:16 #7
Hi Terry


The reason of 3 "medarbejder" in the same record, is because
they work together up to 3 persons at the time, so this report system is keepping track, if one employee make many big mistakes.

Tables are related from lonnummer.medarbejderID to Medarbejder.medarbejderid and Medarbejder.medarbejderid1 and Medarbejder.medarbejderid2


Regards

Tony
Avatar billede terry Ekspert
24. august 2010 - 10:21 #8
so all employees are in the first table and these can be found a number of times in table 2 in either of the columnd?

I see 4 columdn inb the second table with medarb.ID???

Any chance of seeing an example of these tables?
Avatar billede terry Ekspert
24. august 2010 - 10:42 #9
If I understand your data correctly you can make three sub selects each of which selects count where emp.id in the first table is = empid in the second table (col1, col2 or col3)
Avatar billede Newbee1 Novice
24. august 2010 - 11:19 #10
Hi Terry


If you have time I can mail it to you.


I have your email.


Regards

Tony
Avatar billede terry Ekspert
24. august 2010 - 11:51 #11
ekspertenATsanthell.dk

AT = @
Avatar billede terry Ekspert
26. august 2010 - 08:30 #12
svar
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
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

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