Simple method to convert BAQ query to SQL server

A post was split to a new topic: Improving BAQ Performance