RESULTA QUE CUANDO CONSULTO UN DETERMINADO REGISTRO DE LA BASE DE DATOS EN EL CUAL EN UNA COLUMNA DE
TIPO DATETIME. HAGO LA SIGUIENTE CONSULTA.
Código Delphi
[-] with Fmodulo.qry_registra do
begin
SQL.Clear;
SQL.Add('select * from volantes');
SQL.Add('where volante=:volante_a_buscar');
Parameters.ParamByName('volante_a_buscar').Value:=Trim(wbuscar);
try
open;
if not Fmodulo.qry_registra.IsEmpty then
begin
Fregistro.wmodificar:=FieldByname('id_volante').AsString;
Fregistro.txtoficio.Text:=FieldByname('volante').AsString;
Fregistro.txtremitente.Text:=FieldByname('remitente').AsString;
Fregistro.txtfirmado.Text:=FieldByname('firmado_por').AsString;
fregistro.txtasunto.Text:=FieldByname('asunto').AsString;
Fregistro.txtrecibio.Text:=FieldByname('recibe').AsString;
fregistro.txtarchivo.Text:=FieldByname('archivo_en').AsString;
ShortDateFormat := 'dd/mm/yyyy';
fregistro.dtp_fecha_oficio.Date:=StrToDate(FieldByname('fecha_oficio').asString);
fregistro.dtp_fecha_recibido.Date:=StrToDate(FieldByname('fecha_recibido').asString);
Fregistro.dtp_fecha_turno.DateTime:=StrToDate(FieldByname('fecha_turnado').AsString);
Fregistro.cb_personal.Text:= FieldByname('TURNADO_A').AsString;
Fregistro.txtinstrucciones.Text:=FieldByname('para').AsString;
Fregistro.widentificador:=1;
exit;
end
else
begin
Fregistro.widentificador:=0;
end;
except
on E:EOleException do
begin
MessageDlg(Format('Error: %s Codigo: %d', [E.Message, E.ErrorCode]), mtError, [mbOK], 0);
exit;
end;
end;
end;
BIEN CUANDO HAY UN REGISTRO EN EL QUE AUN NO TIENE UNA FECHA. AL REGRESAR UN CAMPO DE TIPOD FECHA PARA CARGARLO AL tDATETIME ME MANDA EL SIGUIENTE ERROR
IS NOT A VALID DATE.
ALGUIEN SABER COMO PONER UNA FECHA EN UN TDATE CUANDO EL CAMPO DE LA BASE DE DATOS DE TIPO FECHA ESTA VACIO?