Subject Re: [IBO] Date Corruption
Author Steve Harp
--- In IBObjects@yahoogroups.com, Lester Caine <lester@l...> wrote:
> Steve Harp wrote:
>
> > I have an Delphi 5 application running against Firebird v1.5.2 and
> > using IBO v4. I'm writing a process to archive old orders to a 2nd
> > Firebird database. I'm creating a target database with a TIB_Script
> > and then using 2 TIB_Connection components to connect to the source
> > and target databases. I'm then using T_IBQuery objects to copy the
> > data across. Everything is peachy and runs with no errors. However,
> > after the copy is completed, I see corrupted date fields in my target
> > orders table. Several dates will show in IbExpert as 12/30/1899. The
> > dates are correct in the source databaes but the two queries
> > (connected to the 2 different TIB_Connection objects show this.
> >
> > Source Target
> > Order_Date = 12/30/1899 - OrderDate = 12/30/1899
> > Ship_Date = 09/26/2001 - ShipDate = 09/26/2001
> > Invoice_Date = 09/26/2001 - InvoiceDate = 09/26/2001
> >
> > What could I be doing wrong?
>
> Not actually setting that date?
> 12/30/1899 = day 0 in a Firebird date.
> Datestamps are simply a count of days from day 0 ;)
>
I'm not sure I understand. The source table has the correct date when
viewed in IBExpert. I'm setting it like.

qryTar.FieldByName('OrderDate').AsDate :=
qrySrc.FieldByName('Order_Date').AsDate;

The problem is that the src TIB_Query is reading the date from the
database incorrectly.

Steve