select and where

hy, i use a code for select in a form and works:
SELECT id, sc_concat(Societa,’ - ‘, Indirizzo,’ - ‘, piva,’ - ', codice_fiscale)
FROM clienti
ORDER BY Societa, Indirizzo, piva, codice_fiscale

but if i add a where not works,error sql:

WHERE
( {Stato Anagrafica} )=’ 1’

SELECT id, sc_concat(Societa,' - ', Indirizzo,' - ', piva,' - ', codice_fiscale) 
FROM clienti 
WHERE Stato Anagrafica = 1
ORDER BY Societa, Indirizzo, piva, codice_fiscale

Is this in a form or a grid, i know you said form. But form have a where condition section! Do you mean that?

Form

or

Grid

fileupload.png

fileupload.png

select fails

not works…is in a form

I get a value from a field in another table using autocompletion, I put two photos attached

error-select.jpg

error-select2.jpg

What is the exact name of the db field (Stato Anagrafica)?
If you have a blank in the field name it has to be in left tick marks: Stato Anagrafica
Your Where Clause would be:

WHERE Stato Anagrafica = 1

jsb

I solve issue, find a field with id of primal key