I have the following problem with queries in the grid's

I have the following problem with queries in the grid’s, and check the query in the SQL Builder and I get perfect but when the way to the grid I get an error, the error is when I make a comparison of a field with a character in a join as the following example:
LEFT OUTER JOIN ON SAAIO_GUIAS G (G. NUM_REFE = P. NUM_REFE) AND (G. CONS_GUIA = 1) AND (G. IDE_MH = ‘M’)
If I do join me in giving the following error
Error
Error accessing the database
Dynamic SQL Error SQL error code = -104 Token unknown - line 1, char 605

LEFT OUTER JOIN ON SAAIO_GUIAS G (G. NUM_REFE = P. NUM_REFE) AND (G. CONS_GUIA = 1) AND (G. IDE_MH = 'M ')

when compared to a numerical value is not brand me any errors I say that I have to join other queries comparing numeric values and do not give me error, only when compared with characters.

What is the symbol to compare characters in the grid?

The grid’s support subqueries in the select function?

If the support I could provide the syntax that I mark my error in that also with other queries.

Re: I have the following problem with queries in the grid’s

You may use a VIEW to create the Grid.

V?tor Jamil

Re: I have the following problem with queries in the grid’s

as I do, if I have more of a table to show you know where I can see an example or you have an example to do so, a little more detail I am new to scriptcase.

Re: I have the following problem with queries in the grid’s

I think there is a problem with code generation. There are too many backslashes.
I have similar problem however I used a join with one variable
e.g. SQL:
FROM
Persons INNER JOIN
Registrations ON Registrations.Persons_idpersons=Persons.idpersons AND Registrations.Programs_idprograms=[local_idprograms]

The generated code is invalid:
if (empty($this->nm_tabela))
{
$this->nm_tabela = “Persons INNER JOIN Registrations ON Registrations.Persons_idpersons=Persons.idpersons AND Registrations.Programs_idprograms=” . $_SESSION[‘local_idprograms’] . “”;
}
Repairing the code works perfect:
if (empty($this->nm_tabela))
{
$this->nm_tabela = “Persons INNER JOIN Registrations ON Registrations.Persons_idpersons=Persons.idpersons AND Registrations.Programs_idprograms=” . $_SESSION[‘local_idprograms’] . “”;
}