Master/detail text parameter

Hi,
I’m tring to create a master/detail application but the key in the master table is a text (A01 in my data). Based on error given bellow, the problem is pass text as a parameter to to detail grid

Se produjo un error al acceder a la base de datos
SQLState: 42S22 Error Code: 207 Message: [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Invalid column name ‘A01’.
select count(*) from dbo.destino where (codigoSucursal = A01)

A01 is the paramter I want to pass to the grid detail, but I think since is a text needs use this format ‘A01’, how to add ’ ’ to the parameter? or another way to pass text parameter?

Thanks and greetings from Ecuador

select count(*) from dbo.destino where (codigoSucursal = ‘A01’)

Put quotes around A01 so it sees it as text and not a column name

Thanks for your reply,
But, I’m not pass the parameter manually, I`m trying to build a master/detail form, so the parameter is passed by the form to the grid. Therefore I don’t know how to add quotes around A01.
Bellow is an image of my form and the error. Thanks and greetings!!!

I guess Scriptcase accepts only integer fields as primary key, when creating master/detail parameter. My suggestion is to create an INTEGER field as primary key and create a new master/detail parameter based on this field.

1 Like