(Sending to the list as I accidently only replied to Roman with my earlier reply) Thanks for your assistance. This was a case of user error. To me the examples I looked at used the double quote (") but on further inspection they do indeed use double single quotes ('). The quote_literal function was also handy for this. Thanks again! Regards, Dan > Double quotes can be used only for identifiers (table, column > names, etc), you want to use single quotes for strings. Now, since > you already are in a string (the function body), you need to escape > the single quotes inside. In SQL this is done by doubling the quote > character, IOW, by putting another single quote just before it: