Hi Michaelle!
If you can show us some prints or error logs as Sourav said I think we will understand a little better your problem to try to help you.
Just to make sure, when you say advanced query plugin you mean the default SQL element from OutSystems Service Studio? Or some forge component?
If you are using an extension to connect to this external database, have you tried to open it with Integration Studio and checked the mapped data type of your tables' attributes?
If using a SQL advanced query element, are you using the correct type in your return structure?
I hope we can help you!
Cheers and Regards,
RR :)