Actually wanted to add to this, as having done a bit of googling this seems to be a fairly common query, but havent' managed to find the answer. Although the code you gave worked a treat on my local server, when I uploaded to my remote server on update I got the following message:
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay.
Is this something that I can fix within the page code or do I need to contact the hosting provider?
Thanks again.