Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

counting number of visits query 1

Status
Not open for further replies.

topwaya

Technical User
May 4, 2005
150
US
I am trying to have a query display the number of visits for a specific location. Does someone have an idea on where I'm going wrong?

Code:
SELECT [Fitness Center Location] AS WorkOutLocation, Count(*) AS [Distinct Visits]
FROM qryFCVisitsPID
GROUP BY [Fitness Center Location]
HAVING (("WOLoc"=[Fitness Center Location]));

The qryFCVisitsPID is:
Code:
SELECT DISTINCT tblLoc.LocName, tblFCUtil.PID, tblFCUtil.WOD, tblFCUtil.WOTme, tblFCUtil.WOLoc
FROM tblLoc INNER JOIN tblFCUtil ON tblLoc.LocID = tblFCUtil.WOLoc;

The qryFCVisitsPID shows me each visit by each person, I ultimately want to have have a form with a drop down box to filter the visits by WOLoc (workout location), LocName (work location), or person (PID).

Any help is appreciated - thank you!!

 
Something like this ?
SELECT WOLoc AS WorkOutLocation, Count(*) AS [Distinct Visits]
FROM qryFCVisitsPID
WHERE WOLoc="Fitness Center Location]"
GROUP WOLoc;


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thank you very much!!

The following worked like a charm!

Code:
SELECT WOLoc AS WorkOutLocation, Count(*) AS [Distinct Visits]
FROM qryFCVisitsPID
WHERE WOLoc="[Fitness Center Location]"
GROUP BY WOLoc;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top