Ver Mensaje Individual
  #5  
Antiguo 28-06-2012
Petolansa Petolansa is offline
Miembro
 
Registrado: jul 2005
Posts: 159
Reputación: 19
Petolansa Va por buen camino
Gracias Chamix, si es verda, pero respecto a si guardar como date o date time ya habia probrado, ahora manejo el mismo tipo de dato datetime, al igual que la variable. Pero asi y todo, siempre me dice que la carga se ha realizado con el exito, no me toma la busqueda. DOnde puede estar el tema?.

Código Delphi [-]
procedure TForm12.BitBtn2Click(Sender: TObject);
begin
FECHAGUARDIA:=datetimepicker1.DateTime;
query2.close;
query2.sql.text := 'select * from GUARDIAS where GDNI=NIGUARDIA and GFECHAGUARDIA=:FECHAGUARDIA';
query2.Params[0].AsInteger := strtoint(dbtext7.Caption);
query2.Params[1].AsDatetime:= fechaguardia;
query2.open;
if query2.recordcount>0 then
begin
Showmessage('La guardia ya se ha cargado')
end
else
begin
table2.Insert;
table2.FieldByName('GDNI').Value:=strtoint(dbtext7.Caption);
table2.FieldByName('GFECHAGUARDIA').AsDateTime:=trunc(datetimepicker1.DateTime);
table2.Post;
ShowMessage('La carga se realizo con exito');
   end;
close;

Gracias gente. Saludos
Responder Con Cita