Ver Mensaje Individual
  #1  
Antiguo 23-01-2010
aanil aanil is offline
Miembro
 
Registrado: abr 2006
Posts: 155
Reputación: 21
aanil Va por buen camino
Consulta con el operador AND

Hola a todos:

Quien pude decirme el por qué este código me produce un error?

Veamor
Código SQL [-]
procedure TForm4.SpeedButton1Click(Sender: TObject);
begin
If radiobutton1.Checked = true then begin
with datam.ADOQuery1 do begin
close;
sql.Clear;
sql.Add('select * FROM tabla1');
sql.Add('where nombres = '+QUOTEDSTR (edit1.Text)  and centro_educ ='+QUOTEDSTR (edit2.Text));
sql.Add('order by nombres asc');
open;

If (edit1.Text ='') or (edit2.Text = '') then
Showmessage ('Debes escribir datos correctos');
end;
end;
end;



end.

Aclaro que error se produce por ahora en la linea que tiene la condición Where.

Gracias.
Responder Con Cita