Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Query Problem
Message
Information générale
Forum:
Microsoft Office
Catégorie:
Access
Titre:
Divers
Thread ID:
01520976
Message ID:
01521422
Vues:
15
>>Ok, so here's what I have now:
>>
>>
>>SELECT d.GroupId, 
>>       Sum(d.cert_complete) AS SumOfcert_complete, 
>>       Count(d.cert_complete) AS CountOfcert_complete
>>    FROM (SELECT DISTINCT s.GroupId, e.EmployeeID, IIf(e.Certified Is Null,0,1) AS cert_complete 
>>    FROM ((Stores AS s 
>>    INNER JOIN EmployeeStores AS es ON s.StoreId=es.StoreId) 
>>    INNER JOIN Employees AS e ON es.EmployeeId=e.EmployeeID) 
>>    INNER JOIN Titles AS t ON e.TitleId=t.TitleId WHERE t.IsManager=True AND e.IsActive=True)  AS d
>>    GROUP BY d.GroupId
>>UNION ALL SELECT 0 as GroupId, 
>>       Sum(d.cert_complete) AS SumOfcert_complete, 
>>       Count(d.cert_complete) AS CountOfcert_complete
>>    FROM (SELECT DISTINCT s.GroupId, e.EmployeeID, IIf(e.Certified Is Null,0,1) AS cert_complete 
>>    FROM ((Stores AS s 
>>    INNER JOIN EmployeeStores AS es ON s.StoreId=es.StoreId) 
>>    INNER JOIN Employees AS e ON es.EmployeeId=e.EmployeeID) 
>>    INNER JOIN Titles AS t ON e.TitleId=t.TitleId WHERE t.IsManager=True AND e.IsActive=True)  AS d;
>>
>>
>>I'm no longer getting prompted, but it's not filter out inactive employeed either. I don't see what's wrong.
>
>It should filter the inactive employees. Did you try selecting just the inner derived table and see, if you have inactive employees there?

When I run this
SELECT *
    FROM (SELECT DISTINCT s.GroupId, e.EmployeeID, IIf(e.Certified Is Null,0,1) AS cert_complete 
    FROM ((Stores AS s 
    INNER JOIN EmployeeStores AS es ON s.StoreId=es.StoreId) 
    INNER JOIN Employees AS e ON es.EmployeeId=e.EmployeeID) 
    INNER JOIN Titles AS t ON e.TitleId=t.TitleId WHERE t.IsManager=True AND e.IsActive=True)  AS d
It doesn't appear to be returning active employees. I'm getting back EmployeeId as part of the result set, and no inactive id's appear in the set.
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform