I have the following query that counts the total number of visits to a facility. I would ALSO like to count the total number of UNIQUE visits.
For instance, total visits might 100, it is how times anyone has visited.
Unique visits might be 42, it is how many unique individuals visited.
Here is my SQL - how do I count distinct number of visits? I haven't been able to figure it out. the tblFCUtil.PID needs to also be distinctly counted to get what I want.
Thanks for any help!
For instance, total visits might 100, it is how times anyone has visited.
Unique visits might be 42, it is how many unique individuals visited.
Here is my SQL - how do I count distinct number of visits? I haven't been able to figure it out. the tblFCUtil.PID needs to also be distinctly counted to get what I want.
Code:
SELECT tblLoc.LocName, Count(tblFCUtil.PID) AS NumberOfFCVisits, tblFCUtil.WOD, tblFCUtil.WOTme, tblFCUtil.WOLoc, tblFCUtil.PID
FROM tblLoc INNER JOIN tblFCUtil ON tblLoc.LocID = tblFCUtil.WOLoc
GROUP BY tblLoc.LocName, tblFCUtil.WOD, tblFCUtil.WOTme, tblFCUtil.WOLoc, tblFCUtil.PID, tblLoc.LocID
ORDER BY tblLoc.LocName;
Thanks for any help!