Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Query Problem
Message
General information
Forum:
Microsoft Office
Category:
Access
Title:
Miscellaneous
Thread ID:
01520976
Message ID:
01521455
Views:
11
>>You're not going to beleive this... I'm looking at the wrong query!!! Sleep deprivation..
>>
>>Anyhow, I went back to the report to see if I was just not seeing something, and realized that the report is using this:
>>
>>
>>SELECT Employees.FirstName, 
>>       Employees.LastName,
>>       Employees.IsActive,
>>       Classes.ClassId, 
>>       Classes.ClassName, 
>>       EmployeeClasses.AttendedDate, 
>>       EmployeeClasses.Score, 
>>       Stores.StoreId, 
>>       Stores.StoreNumber, 
>>       Stores.StoreNumber+" - "+Stores.StoreName AS StoreName, 
>>       [FirstName] + " " + [LastName] + " - " + Titles.Title AS FullName
>>    FROM (((Classes INNER JOIN (Employees INNER JOIN EmployeeClasses 
>ON Employees.EmployeeId=EmployeeClasses.EmployeeId
>AND Employees.IsActive = True
>
>) ON ClassId=EmployeeClasses.ClassId) 
>>    INNER JOIN EmployeeStores ON Employees.EmployeeId=EmployeeStores.EmployeeId) 
>>    INNER JOIN Stores ON EmployeeStores.StoreId=Stores.StoreId) 
>>    LEFT JOIN Titles ON Employees.TitleId=Titles.TitleId
>>    ORDER BY StoreNumber;
>>
>>
>>But I still for the life of me cannot get it to accept "Employees.IsActive=True" anwhere. My problem is that I can't seem to understand this nested JOIN syntax. It doesn't make sense..
>>
>>IsActive is showing up as a column in the designer, but not in the SQL. How do I add in "Employees.IsActive=True"???????
>
>I think the simplest way will be to insert this condition into JOIN condition. See the change I made.


I GOT IT!!!

I went back to the designer and saw that the Criteria for the IsActive column was empty. So I set it to True and it produced this code.
SELECT Employees.FirstName, Employees.LastName, Classes.ClassId, Classes.ClassName, EmployeeClasses.AttendedDate, EmployeeClasses.Score, Stores.StoreId, Stores.StoreNumber, Stores.StoreNumber+" - "+Stores.StoreName AS StoreName, [FirstName]+" "+[LastName]+" - "+Titles.Title AS FullName, Employees.IsActive
FROM (((Classes INNER JOIN (Employees INNER JOIN EmployeeClasses ON Employees.EmployeeId = EmployeeClasses.EmployeeId) ON Classes.ClassId = EmployeeClasses.ClassId) INNER JOIN EmployeeStores ON Employees.EmployeeId = EmployeeStores.EmployeeId) INNER JOIN Stores ON EmployeeStores.StoreId = Stores.StoreId) LEFT JOIN Titles ON Employees.TitleId = Titles.TitleId
WHERE (((Employees.IsActive)=True))
ORDER BY Stores.StoreNumber;
Note the IsActive=True.

Thanks for your patience.

Kevin
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Previous
Reply
Map
View

Click here to load this message in the networking platform