#1 2017-03-09 07:34:58

mingda
Member
Registered: 2013-01-04
Posts: 121

'0.42793' is not a valid timestamp

when I do report, i use ExecuteJson to get a sql json resut, then convert to TSynSQLTableDataSet,

json := Client.ExecuteJson([], DataSetSql);
JSONTODataSet(nil, Json),

just found, if there is only one row, if a RawUTF8 string field has 2017-02-27 content,
in the json content look like this, "XXX":"2017-02-27", then report engline use
     FValue := DataSet.Value[DataField];
to get value will generate AV '0.42793' is not a valid timestamp, seems the underline
field treat as datetime, how can resolve this.

Any help very thanks!

update:
I think if can manul set the field type, then will ok, I'll test this method.

update2:
Seems the under TSQLTable can SetFieldType, but the TSynSQLTableDataSet's field type
can't change, in
function TSynVirtualDataSet.GetFieldData(Field: TField; Buffer: Pointer): Boolean;

  Data := GetRowFieldData(Field,RowIndex,DataLen,OnlyTestForNull);

GetRowFieldData can work, but next run to

  ftDateTime:
    PDateTimeRec(Dest)^.DateTime := PDateTime(Data)^;

after that has become '0.0' is not a valid timestamp

update 3:
  First create a TSQLTable, manual set field type, then use it create DataSet seems resolve the problem.


Mingda

Last edited by mingda (2017-03-09 14:35:38)

Offline

#2 2017-03-09 18:11:57

Junior/RO
Member
Registered: 2011-05-13
Posts: 207

Re: '0.42793' is not a valid timestamp

What version of mORMot are you using?

Offline

#3 2017-03-09 18:16:23

Junior/RO
Member
Registered: 2011-05-13
Posts: 207

Re: '0.42793' is not a valid timestamp

For me, the last good mORMot commit is 938ae78a5b5ecb464e8e0d7d8544ba3a9e09eb38, january, 23. Every commit after that raises '0.4<something> is not valid timestamp'.

Offline

#4 2017-03-09 18:53:13

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 332

Re: '0.42793' is not a valid timestamp

I had this problem in my https://synopse.info/forum/viewtopic.ph … 511#p23511 and I had patch the DataConvert procedure. Try to use my TSynRestDataset to test if it works for you.

Best regards.

Esteban


Esteban

Offline

#5 2017-03-10 01:18:46

mingda
Member
Registered: 2013-01-04
Posts: 121

Re: '0.42793' is not a valid timestamp

@Junior/RO
I use 3469,

@EMartin
Sorry, I can't reach the google site, only update from ab's

thank you two!

Offline

#6 2017-03-12 01:58:07

daisutao
Member
Registered: 2015-05-08
Posts: 17

Re: '0.42793' is not a valid timestamp

Indeed,
So i use version c8915b80ceef724651b4e97e7f222cd83de69bbb in 2017/1/20.

Offline

Board footer

Powered by FluxBB