How to get millisecond value from Timestamp field in firebird using Delphi 2007

I have a Firebird database (runs on a server version 2.1.3) and connect to it with Delphi 2007 using DBExpress objects (using the Interbase driver)

One of my tables in the database looks something like this:

CREATE TABLE MYTABLE
(
  MYDATE Timestamp NOT NULL,
  MYINDEX Integer NOT NULL,
  ...
  Snip
  ...
  PRIMARY KEY (MYDATE ,MYINDEX)
);

I can add OK to the table, and in Flame Robin, a timestamp field that has a millisecond value.

But when I do select all ( select * from MYTABLE) in the table, I cannot get the value of the millisecond, since it always returns as 000.

This causes serious problems, as it is part of the primary key (unfortunately, I did not design the table and I have no right to modify it).

I tried the following to get the millisecond value:

sql1.fieldbyname('MYDATE').AsDateTime;
sql1.fieldbyname('MYDATE').AsSQLTimeStamp;
sql1.fieldbyname('MYDATE').AsStirng;
sql1.fieldbyname('MYDATE').AsFloat;

14/09/2009 14: 25: 06.000 .

?

UPDATE: , - , , DBExpress .

+3
4

, Firebird , , InterBase Delphi 2007 . , InterBase C API; InterBase DateTimes , InterBase API C TM, . dbExpress, InterBase, . , , , Firebird .

+4

( ) : FIBplus!

FIBPlus 6.9.6 Firebird 2.1.1.

current_timestamp FormatDateTime('dd-mm-yyyy hh:nn:ss:zzz', TestpFIBDataSetMYDATE.Value) , .

-

+5

FAQ Firebird โ„– 305 , varchar CAST.

+2

Source: https://habr.com/ru/post/1717664/


All Articles