Subject | Re: TDateTime field |
---|---|
Author | Adam |
Post date | 2005-04-06T06:10:54Z |
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:
Current_Date
Current_Time
Now
But you can look them up.
Hope that is a start
Adam
--- In firebird-support@yahoogroups.com, "Dion Oliphant"
<doliphant@s...> wrote:
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:
Current_Date
Current_Time
Now
But you can look them up.
Hope that is a start
Adam
--- In firebird-support@yahoogroups.com, "Dion Oliphant"
<doliphant@s...> wrote:
> Hi,the
>
> I convert a datetime string into an equivalent datetime value using
> local machines shortdateformat local global settings. I then try and( '+''''+InvRec.ReceiptNo+''', '''+InvRec.InvocieNo+''', '+
> insert this value into a TDate field in an FB table, but get an:-
> ISC ERROR MESSAGE:
> conversion error from string "38204" error.
>
> My insert:-
>
> ..'Values
> FloatToStr(aDate)+', '+ReceiptDate,
>
> 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.