I have an application that supports multiple SQLite databases the schema of which is outside of my control.
One of the databases has fields with a definition similar to
create table test (f1 varchar, f2 timestamp)
however that data written to f2 is a float (sqlite allows this) and when I run a simple select query I get an ecception "29222606067.14 julian cannot be represented as a datetime"
How can I trap this situation and deal with it?
Trapping exception to dynamically code a work around
Re: Trapping exception to dynamically code a work around
Further to this
I have data typeing mapping to map between a datetime and a float (or vice versa) - but the same error occurs.
I see that something similar has come up before and I notice in the release notes for version 5 it says
I have data typeing mapping to map between a datetime and a float (or vice versa) - but the same error occurs.
I see that something similar has come up before and I notice in the release notes for version 5 it says
If this is fixed, how do I implement it on a field by field basis?Converter from Unix and Julian data formats to ftDateTime is added
Re: Trapping exception to dynamically code a work around
Hello,
To get such date as Float, you should set the NativeDate option to False and use the AsFloat method for the field. If you want to display such float values in the grid, you can use the onGetText event of this field, retrieve the value using the AsFloat method, map it explicitly to string or to date by modifying it as required.
To get such date as Float, you should set the NativeDate option to False and use the AsFloat method for the field. If you want to display such float values in the grid, you can use the onGetText event of this field, retrieve the value using the AsFloat method, map it explicitly to string or to date by modifying it as required.