A
adamctaylor
Hello everyone-
I am trying to pull the name and number of visits for the top visitor
to a website by client and I am having trouble.
Each client can have more than one user. My goal end result is:
ClientAdminID UserName Visits
-------------------------------------------------------
1 Doe, John 9999
2 Doe, Sue 9999
etc...
I am using the following:
SELECT tblLBEUsers.ClientAdminID, tblLBEUsers.UserNamr, tblLBELogons.
[2007]
FROM tblLBEUsers INNER JOIN tblLBELogons ON tblLBEUsers.UserID =
tblLBELogons.UserID
WHERE ( tblLBELogons.[2007]=(SELECT a.ClientAdminID, Max(b.[2007]) AS
MaxOf2007
FROM tblLBEUsers AS a INNER JOIN tblLBELogons AS b ON a.UserID =
b.UserID
GROUP BY a.ClientAdminID ))
GROUP BY tblLBEUsers.ClientAdminID;
And now I am getting some message about needing an EXISTS clause in
the main query's FROM clause. From other threads it sounds like this
might not really be what is going on. Can anyone help me out?
TIA,
Adam
I am trying to pull the name and number of visits for the top visitor
to a website by client and I am having trouble.
Each client can have more than one user. My goal end result is:
ClientAdminID UserName Visits
-------------------------------------------------------
1 Doe, John 9999
2 Doe, Sue 9999
etc...
I am using the following:
SELECT tblLBEUsers.ClientAdminID, tblLBEUsers.UserNamr, tblLBELogons.
[2007]
FROM tblLBEUsers INNER JOIN tblLBELogons ON tblLBEUsers.UserID =
tblLBELogons.UserID
WHERE ( tblLBELogons.[2007]=(SELECT a.ClientAdminID, Max(b.[2007]) AS
MaxOf2007
FROM tblLBEUsers AS a INNER JOIN tblLBELogons AS b ON a.UserID =
b.UserID
GROUP BY a.ClientAdminID ))
GROUP BY tblLBEUsers.ClientAdminID;
And now I am getting some message about needing an EXISTS clause in
the main query's FROM clause. From other threads it sounds like this
might not really be what is going on. Can anyone help me out?
TIA,
Adam