Ver Mensaje Individual
  #1  
Antiguo 05-11-2022
steelha steelha is offline
Miembro
 
Registrado: mar 2012
Posts: 158
Reputación: 13
steelha Va por buen camino
Ayuda Problema tipo cadena/date

Buenas, perdón por molestar un sábado . Mi problema consiste en lo siguiente poseo una tabla en SQL llamada Pacientes en la cual tengo un campo pxnacidoen el cual es de tipo date
pxNacidoen date Nullvalue

Poseo el siguiente código
Código Delphi [-]
procedure TfrmPacientes.guardar_datos;
begin
  if nuevo = 1 then
    begin
      DM.QryPacientes.Insert;
      DM.QryPacientesidpaciente.Value := DM.QryPacientes.RecordCount + 1;
    end
  else
    DM.QryPacientes.Edit ;

  with DM do
  begin
    QryPacientespxNombres.Value   := Trim(edtnombre.Text);
    QryPacientespxApellidos.Value := Trim(edtapellido.Text);
    QryPacientespxDocumento.Value := Trim(edtdocumento.Text);
    QryPacientespxCorreo.Value    := Trim(edtdocumento.Text);
    QryPacientespxDireccion.Value := Trim(mdireccion.Lines.Text);
    QryPacientespxTelefonos.Value := Trim(mtelefono.Lines.Text);
    QryPacientespxEstado.Value    := chkactivo.Checked;
    QryPacientespxNacidoen.Value  := dtpnacimiento.Date; //aca el error de tipo string vs tipo date
    QryPacientes.Post;
  end;

  limpiar;
  deshabilitar;
end;

Por lo que pude ver cuando se crean los campo en el adoquery se crea como tipo Twidestring no entiendo el porque si en sql esta muy bien definido. Alguna idea de como solucionar esto. Ya he borrado la tabla y creado nuevamente igual pasa. Alguna ayuda o consejo
Responder Con Cita