"Not Greater than" operator for date
Posted on 2004-10-11
Did some research and some testing, and cannot find the logic to get my MySQL query to work right.
Basicly, I'm trying to create a statement that would work as a "Not Greater Than" operator.
Some background information:
I am creating a database that holds a list of events, credits, attendees. To work with the database, you first create an event, and then assign members who have attended.
With this information, I would like to generate several reports and statistics.
I already have done many queries that suit my needs, including a query that will show 'active' members - or "show all members who have attended an event 6 times in the past 6 months"
SELECT CONCAT(mem_name_amt, ' (',mem_name_last, ', ',mem_name_first, ')') FullName, COUNT(*) attendance_count
AND evt_date>DATE_ADD(CURRENT_DATE(), INTERVAL -6 MONTH)
GROUP BY members.mem_id
Now I'm stuck - really stuck, because the logic seems so simple.
I need a query that will show 'dead' members - or "show members who HAVE NOT attended an event in the past 6 months"
( Adding "AND NOT(AND evt_date>DATE_ADD(CURRENT_DATE(), INTERVAL -6 MONTH))" only seems to give me the inverse of what I want - or showing me members who have attended before '6 months ago')
Hopefully I have provided enough backgound information to get this question answered.