Subject Re: TDateTime field
Author Adam
The Firebird equivalent is Timestamp.

If you are using delphi, you can use formatdatetime and set it to the
US format. As a side note, it is a really weird way of writing a
date, but we are stuck with it :)

Using your example:

( '+''''+InvRec.ReceiptNo+''', '''+InvRec.InvocieNo+''', '+
FormatDateTime('m/d/yyyy', aDate)+', '+

Timestamp works the same sort of way as TDateTime, + 1 adds one day
etc. The TDate equivalent is "Date" and the TTime Equivalent is "Time"

You can also do things like

select Cast(MyTimeStampField as Date) ...

to convert between the fields.

Other things of interest:


But you can look them up.

Hope that is a start

--- In, "Dion Oliphant"
<doliphant@s...> wrote:
> Hi,
> I convert a datetime string into an equivalent datetime value using
> local machines shortdateformat local global settings. I then try and
> insert this value into a TDate field in an FB table, but get an:-
> conversion error from string "38204" error.
> My insert:-
> ..'Values
( '+''''+InvRec.ReceiptNo+''', '''+InvRec.InvocieNo+''', '+
> FloatToStr(aDate)+', '+
> FloatToStr(InvRec.RecordAmount)+')';
> I use Encode to create aDate. I take it Encode uses the local
> settings(datetime) if I do not override them.
> The sql which is run against the server.
> Insert Into wrkInvoiceHeader ( ReceiptNo, InvoiceNo,
> RecordAmount) Values ( '2690', '7482', 38204, 2548.2)
> What is the FB TDate format equivalent in Delphi?
> Thanks,
> Dion.