Trust ID PBCEX logo 300x102

Large numbers convert to scientific values when stored

12 years 8 months ago
Posts: 64
Topic Author
Large numbers convert to scientific values when stored #125
Problem: I have created a storage item to store the print time and date and to use it as a key in the new table.
I use a custom mask for the print date storage yyyymmddHHmmss (HH in uppercase is 24 hour time)

The field to accept the is a numeric field.
When I view the stored data in my database it shows 1.97001E+13

Cause: Microsoft Programs (Excel, Access) and, possibly other databases from other vendors, display numbers with more than 11 digits as scientific expressions. This is default and standard behavior...go ahead and type 12 digits into an excel spreadsheet cell and you will see what I mean. If the number is over 16 digits the digits after the 16th will be changed to 0's. (yes this is still standard Excel/access behavior)

Solution: Change the filed where the data is being stored to text instead of numeric. Text fields do not have the same length and conversion issues. (Text fields can still have a maximum length set in the DB table configuration) You may have to use a schema.ini file if you are working with text files to set/force the column to be text.

To see more information on schema.ini see the following post

Jason Hicks MBA
National Service & Projects Manager
[Practical Peripherals Corporation Pty Ltd (Australia) ]
"No we don't really eat much Kangaroo meat here, Cows are much easier to catch"