Z
zwanz P via AccessMonster.com
i got the following queries:
querie1:
SELECT DISTINCT x1.Mdw_Naam, x1.Openstaand, IIf(Installatie1,Installatie1,0) AS Installatie, IIf(x3.Storing1,x3.Storing1,0) AS Storing, IIf( x4.wijziging1, x4.wijziging1, 0 ) AS Wijziging
FROM (([SELECT Mdw_Naam, COUNT([w/s]) As Openstaand
FROM qry_openstaandetickets
GROUP BY tbl_Medewerkers.Mdw_Naam
]. AS x1 LEFT JOIN [SELECT Mdw_Naam, count(*) As Installatie1
FROM qry_OpenstaandeTickets
WHERE [w/s]="Installatie"
GROUP BY Mdw_Naam
]. AS x2 ON x1.Mdw_Naam = x2.Mdw_Naam) LEFT JOIN [SELECT Mdw_Naam, count(*) As Storing1
FROM qry_OpenstaandeTickets
WHERE [w/s]="Storing"
GROUP BY Mdw_Naam
]. AS x3 ON x1.Mdw_Naam = x3.Mdw_Naam) LEFT JOIN [SELECT Mdw_Naam, count(*) As Wijziging1
FROM qry_OpenstaandeTickets
WHERE [w/s]="Wijziging"
GROUP BY Mdw_Naam]. AS x4 ON x1.Mdw_Naam = x4.Mdw_Naam;
qry_openstaandeTickets:
SELECT HDTicket.*, tbl_Medewerkers.Mdw_Naam
FROM HDTicket LEFT JOIN tbl_Medewerkers ON HDTicket.Spec1 = tbl_Medewerkers.Mdw_ID
WHERE (((HDTicket.Afgedaan) Is Null)) AND ((HDTicket.Stat1) <> "klaar");
The first querie counts several stuff, like howmany installations some1 has to do and howmany hardware changes a person has to make .....
mwd.naam = The person his full name (Peter Gabriel)
SPEC1, 2 = The person his small name (peG)
openstaand = howmany stuff he has to do in total (installatie, storing and wijziging)
installatie = howmany installations he has to make
storing = howmany uhm how u call it..
uhm doesnt matter now 
wijziging = howmany soft/hardware changes
Now the querie shows only if a person is in column: SPEC1
But, infact 2 persons can be assigned @ the same job.
In the database there are 2 Columns: spec1 AND spec2
The querie above only counts a person in the column SPEC1 but i also want to count the column SPEC2.
Some1 can tell me how to do this? arg my english is so poor ;<
querie1:
SELECT DISTINCT x1.Mdw_Naam, x1.Openstaand, IIf(Installatie1,Installatie1,0) AS Installatie, IIf(x3.Storing1,x3.Storing1,0) AS Storing, IIf( x4.wijziging1, x4.wijziging1, 0 ) AS Wijziging
FROM (([SELECT Mdw_Naam, COUNT([w/s]) As Openstaand
FROM qry_openstaandetickets
GROUP BY tbl_Medewerkers.Mdw_Naam
]. AS x1 LEFT JOIN [SELECT Mdw_Naam, count(*) As Installatie1
FROM qry_OpenstaandeTickets
WHERE [w/s]="Installatie"
GROUP BY Mdw_Naam
]. AS x2 ON x1.Mdw_Naam = x2.Mdw_Naam) LEFT JOIN [SELECT Mdw_Naam, count(*) As Storing1
FROM qry_OpenstaandeTickets
WHERE [w/s]="Storing"
GROUP BY Mdw_Naam
]. AS x3 ON x1.Mdw_Naam = x3.Mdw_Naam) LEFT JOIN [SELECT Mdw_Naam, count(*) As Wijziging1
FROM qry_OpenstaandeTickets
WHERE [w/s]="Wijziging"
GROUP BY Mdw_Naam]. AS x4 ON x1.Mdw_Naam = x4.Mdw_Naam;
qry_openstaandeTickets:
SELECT HDTicket.*, tbl_Medewerkers.Mdw_Naam
FROM HDTicket LEFT JOIN tbl_Medewerkers ON HDTicket.Spec1 = tbl_Medewerkers.Mdw_ID
WHERE (((HDTicket.Afgedaan) Is Null)) AND ((HDTicket.Stat1) <> "klaar");
The first querie counts several stuff, like howmany installations some1 has to do and howmany hardware changes a person has to make .....
mwd.naam = The person his full name (Peter Gabriel)
SPEC1, 2 = The person his small name (peG)
openstaand = howmany stuff he has to do in total (installatie, storing and wijziging)
installatie = howmany installations he has to make
storing = howmany uhm how u call it..
wijziging = howmany soft/hardware changes
Now the querie shows only if a person is in column: SPEC1
But, infact 2 persons can be assigned @ the same job.
In the database there are 2 Columns: spec1 AND spec2
The querie above only counts a person in the column SPEC1 but i also want to count the column SPEC2.
Some1 can tell me how to do this? arg my english is so poor ;<