I have made a mistake in my original post:
To detect expired accounts, the query should be:
(curdate() > enddate OR closed <> 0) //Expired accounts
Thanks r937,
There are two problems with this though.
Firstly, the account.memberid is a foreign key, so to maintain referential integrity, this...