Perhaps you may find what you are looking for in the website myFMbutler.com
They have a plug in called doSQL, I am very new to filemaker pro and found it a bit hard to follow but I think is
worth mentioning here just in case it solves your problem.
Thanks! I'll have a play. I really appreciate the tip.