Create building of query

This is where the problem is with the query.

( this drop down query and the other is text box query)