To call a function from a query, just add the function name in the criteria box followed by parens
ex - function()
This will return the value of the function call back to the specific field you set the criteria for.
If the function returns a string, the query will return everything equal to the string for that field.
I don't think its possibly to call an internal function from an external query, but don't quote me on this..
-BGrego