Jimmy, the problem you have here is the fact that there are no 'helper' fields in your table. What you really need to have is, at the very least, a field call 'lStatus' that shows a member's previous status type.
So, say you had a dataset like this (new column added):
Code:
Member statusType date correction lStatus
25 C 2008-12-03 up B
25 A 2008-12-23 down B
25 C 2008-12-23 up B
...that would make the query job a little easier.
But even if you didn't do that, you can still query your data out by doing this:
Code:
SELECT DISTINCT fname, lname, email
FROM person
'first condition
WHERE (year([date]) = 2009 AND statustype = 'c') OR
'second condition
(pid IN (
SELECT TOP 1 pid FROM person WHERE
(year([date]) < 2009 AND statustype = 'C'
ORDER BY [DATE] DESC)) AND
(pid IN (
SELECT TOP 1 pid FROM person WHERE
(year([date]) > 2009 AND statustype = 'c'
ORDER BY [DATE] ASC))))
it is checking for 2 possibilities...
1-if the person sank/rose to the status level 'c' at any 2009 date, AND
2-if the person had a designation of 'c' the entire year of 2009 (if they did, the first sql condition would not catch this).
the 1st condition checks for #1, the second condition checks for #2.
make sense? (oh yeah, and you need to replace all the single quote with doubles. I was thinking php. sorry.