Board index » delphi » Help with Date & Time into Date field and Time field

Help with Date & Time into Date field and Time field

Hi I'm trying to use date & time picker
so the user can select a date and time of a flight
(this is a flight log book application)

MY code
flights.FieldByName('Date').AsDateTime:=FlightsDate.value;
always returns
12/30/1899  to the DB field .
Which is a Paradox db and the field is a date field.

What could I be doing wrong?
Thanks
Phil
cr...@craftmark.com

 

Re:Help with Date & Time into Date field and Time field


I'm not sure I understand what you want to do, but it seems you're not
feeding any value to your field. 12/30/1899 is what you will find in an
empty date field in a Paradox table. Maybe you're not using a db aware date
selector? What does FlightsDate represent? If you're not, you should do a
post after the line

flights.FieldByName('Date').AsDateTime:=FlightsDate.value;

like so :

begin
    Table1.Edit;
    flights.FieldByName('Date').AsDateTime:=FlightsDate.value;
    Table1.Post;
end;

Alain Quesnel

Quote
Cr...@craftmark.com wrote in message ...
>Hi I'm trying to use date & time picker
>so the user can select a date and time of a flight
>(this is a flight log book application)

>MY code
>flights.FieldByName('Date').AsDateTime:=FlightsDate.value;
>always returns
>12/30/1899  to the DB field .
>Which is a Paradox db and the field is a date field.

>What could I be doing wrong?
>Thanks
>Phil
>cr...@craftmark.com

Other Threads