Appropriate SQL cannot be generated.
SQL Server Enterprise Manager requires that you follow specific rules when designing queries. This error may appear if you have used the diagram or grid pane to create a query that cannot be expressed in a Transact-SQL statement.
Verify the query options you have selected.
Filtering Rows with WHERE and HAVING | Query Fundamentals |