Ver Mensaje Individual
  #2  
Antiguo 07-11-2005
Avatar de vtdeleon
vtdeleon vtdeleon is offline
Miembro
 
Registrado: abr 2004
Ubicación: RD & USA
Posts: 3.236
Reputación: 26
vtdeleon Va por buen camino
Saludos
Cita:
Empezado por Nelly
una fecha(Pero en la fecha hay una condición, quiero que muestre solo la fecha que eligire en el combo, no quiero que me arroje 10 o más fechas, solo la fecha del combo seleccionada.),..
No estoy seguro, si acabo de entender
Código Delphi [-]
procedure Tfrmrep.btnbuscarClick(Sender: TObject);
var
 evento:integer;
begin
 evento:=cmbevento.keyvalue;
 if evento in [1,2]>'' then begin//QUE ESTAS EVALUANDO AQUI, ESTA MAL ESTA CONDICION
  qryrep.Active:=false;
  qryrep.SQL.Clear;
  qryrep.SQL.Add('select * from eventos');
  qryrep.SQL.Add('where cve_evento=:cve_evento');
  qryrep.ParamByName('cve_evento').AsInteger;//No estas asignando nada  al parametro
  qryrep.Active:=true;
 end else begin
 if (cmbevento.KeyValue>'') or (cmbfechevento.DateTime>'') or  (cmbmunicipio.KeyValue>-1) then begin
  qryrep.SQL.Clear;
  qryrep.SQL.Add('select * from eventos where cve_mpo=:cve_mpo ');
  qryrep.SQL.Add('where cve_evento starting with: clave and ');
  qryrep.SQL.Add('fecha_evento starting with: fecha and ');
{Veo de where en la misma sentencia}
  qryrep.ParamByName('clave').AsInteger:=cmbevento.KeyValue;
  qryrep.ParamByName('fecha').AsDateTime;//No asignas nada
  qryrep.ParamByName('cve_mpo').AsInteger:=cmbmunicipio.KeyValue;
  qryrep.Active:=true;
 end else begin
  ShowMessage('');
 end;
end;
end;
No aporto mas hasta aclara esos puntos
__________________
Van Troi De León
(Not) Guía, Code vB:=Delphi-SQL, ¿Cómo?
Viajar en el tiempo no es teóricamente posible, pues si lo fuera, ya estarían aqui contándonos al respecto!

Última edición por vtdeleon fecha: 07-11-2005 a las 22:12:26. Razón: indent
Responder Con Cita