I must admit I was unfamiliar with the xxxFunc() syntax Eduard's code used. So I decided to track it down in the documentation:

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

That comes from the 2012.2 release notes and reads as follows:

Func() Method Added To Query Classes
A new query member method is available for use, Func. Func() accepts actual values corresponding to the formal parameters defined by the query. It returns an instance of %SQL.StatementResult. When the Func method executes successfully that instance of %SQL.StatementResult is a result set.


If an application has a class with a method whose name is the same as a query name concatenated with "Func", then a member method name collision will be reported at compile-time. Refer to the %Library.Query class for more information.

Setups are managed in the Security subsection of the System Administration section of Portal.

Key documentation is at http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=...

Parts specifically relevant to SQL access to data include:

This is a good point. I was relying on the doc at http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=... being correct when it says:

Binary Sorts after tests whether the left operand sorts after the right operand in numeric subscript collation sequence. In numeric collation sequence, the null string collates first, followed by canonical numbers in numeric order with negative numbers first, zero next, and positive numbers, followed lastly by nonnumeric values.

Judging by this subsequent post by [@Mike.Kadow6569] he resolved this issue. I'm posting this answer so his question no longer reports as having no answer.

This link posted in a comment by [@Joyce Zhang] is a good resource for Mike's problem.

Mike, please set the checkmark against this answer, or any other that may appear, so as to mark the question "answered" in DC.