Anthony and Robert thanks a lot for your help !
The query works perfectly with the < and > escaping. Nevertheless, I'm trying to follow the best practices and will move the queries to the actionscript from now as suggested.
Have a nice day,
Pierre