in reply to place holder error
You may need to do some sanity-checking before you construct your query...