SQL Server float to Real field conversion bug
Posted: Wed 06 Nov 2013 04:47
Hello!
Delphi XE2
UniDAC 5.1.4
Table on MS SQL Server 2005 Express with two fields of REAL type wich stores float values from Delphi TDateTime type.
After upgrade UniDAC version our old project has been fixed with adding Data Type Mapping to Float in UniQuery designer.
Now when Insert values of Delphi TDateTime type (in mean of Date part) into these REAL fields we have not expected results:
AsSingle not works (writes 0 instead any actual values).
With old version of UniDAC (is not recognized what actual was) all was clear and works.
What happend with actual float value before it passed to query parameter? How to fix this behaviour?
Delphi XE2
UniDAC 5.1.4
Table on MS SQL Server 2005 Express with two fields of REAL type wich stores float values from Delphi TDateTime type.
After upgrade UniDAC version our old project has been fixed with adding Data Type Mapping to Float in UniQuery designer.
Now when Insert values of Delphi TDateTime type (in mean of Date part) into these REAL fields we have not expected results:
This behaviour presents for both FieldByName(...).AsFloat and FieldByName.Value assigns.Delphi TDateTime: 41584.7093669676 (is right)
Query parameter value from DBMonitor: -3.68934881474191E19 (is wrong)
Actual field value after insert: -3.68934881474191E19 (is wrong)
AsSingle not works (writes 0 instead any actual values).
With old version of UniDAC (is not recognized what actual was) all was clear and works.
What happend with actual float value before it passed to query parameter? How to fix this behaviour?