Jeremy Campbell
asked on
Need help troubleshooting Access Query SQL
I managed to get this working with just the one join but can't seem to add the second one in.
Here is the code;
Here is the error;
Thanks in advance for the help!
Here is the code;
SELECT A.UserCount, C.NotifyCount
FROM
(
SELECT 1 AS Num, Count(B.tblCurrentUsers.UserID) AS UserCount
FROM (
SELECT tblCurrentUsers.UserID, tblCurrentUsers.AppType, Max(tblCurrentUsers.DateTime) AS MaxOfDateTime, Last(tblCurrentUsers.LogType) AS LastOfLogType FROM tblCurrentUsers GROUP BY 1,
tblCurrentUsers.UserID, tblCurrentUsers.AppType HAVING (((Last(tblCurrentUsers.LogType))="LogOn"))
) AS B
) AS A
LEFT JOIN
(
SELECT 1 AS Num, Count(D.tblNotifications.Read) AS NotifyCount
FROM
(
SELECT tblNotifications.Read
FROM tblNotifications WHERE (((tblNotifications.Read)=False))
) AS D
) AS C
ON A.Num = C.Num
LEFT JOIN
(
SELECT 1 AS Num, Count(E.tblEnhance.ID) AS EnhanceCount
FROM
(
SELECT tblEnhance.ID
FROM tblEnhance
WHERE (((tblEnhance.Completed)=False))
) AS E
) AS F
ON A.Num = F.Num
Here is the error;
Thanks in advance for the help!
if you remove line 13-24 (and first line make it "select *"), does it run?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Figured it out.
Thanks for your input though fellows!
Thanks for your input though fellows!
I don't see an ON clause anywhere that relates B to A, D to C, and F to E.