You need to allow SQL statements for the organization. In DocuWare Administration go to System > General. You will see the option to allow SQL statements. Add your organization then Apply. You should not be able to create your queries.
Phil Robson
Senior Director Client Services, Americas