[eluser]Tim Brownlaw[/eluser]
It's a little difficult to work out when all we have is the statement and no other information...
So does it work ( ie no errors ) when you throw it into phpmyadmin or the like...
Have you tried breaking it down and testing the "bits" before trying the whole catastrophe...
Taking it in small steps is a great way to learn how this all works, especially if the result is not what you are expecting.
So time for you to debug it and only you can do that - as you have all the tables and data - we don't!
You can do it!
Cheers