Author Topic: name of clubber, times attended between two dates  (Read 5379 times)

flfox

  • Newbie
  • *
  • Posts: 1
name of clubber, times attended between two dates
« on: November 18, 2010, 09:07:35 PM »
Can you post a query that will make a list of clubbers who have been present (say 5 times in the last 8) and show the clubbers individual total.

Thank you,

FLFOX

Rick Leffler

  • Guest
Re: name of clubber, times attended between two dates
« Reply #1 on: November 29, 2010, 08:53:23 AM »
Sorry for the delay in responding to this request. I'll look into this soon.

HCCAwana

  • Newbie
  • *
  • Posts: 3
Re: name of clubber, times attended between two dates
« Reply #2 on: March 30, 2011, 12:30:41 PM »
Something like this might work. In the code below I've set the dates to be between January 1st and March 1st and the times attended to be greater than 4. You can change those to meet your needs.


SELECT PS.Club_Name, P.Filing_Name, SUM(PS.Attend), SUM(PS.Points)
FROM Person_Session PS, Administration Admin, Person P
WHERE PS.Club_Year=Admin.Current_Club_Year
AND PS.Member_Type='Clubber'
AND PS.Person_Status='Active'
AND P.Person_ID=PS.Person_ID
AND PS.Session_Date BETWEEN '2011-01-01' AND '2011-03-01'
GROUP BY PS.Club_Name, P.Filing_Name
HAVING SUM(PS.Attend) > 4
David Post
Highlands Community Church
Awana DB Admin