The Query Object is often overlooked in Business Central, but it does give SQL’ish access to creating queries, check it out:

The Query Object is often overlooked in Business Central, but it does give SQL’ish access to creating queries, check it out:
support@hougaard.com or
through Twitter on @eHougaard
Hougaard.com – Software
927 Canyon Blvd
North Vancouver, BC, V7R2J9
Canada