Made query operational for single WHERE clause

worked with Rosbel
Deleted blank lines?

Not really sure where this one came from...