I have a program that pulls data from a spreadsheet, does a heap load of calculations then populates a database table with the results.
This has been working for months no problem but this morning it crashed with a SQL 'Multi-step operation generated errors' message. This error usually crops up when the database field format is not appropriate to accept the incoming data. The offending database field was defined as decimal(12,4) but the value the program was trying to put into it was 3.00000000000011E-02. As soon as I used the CDbl function to convert, it ran through OK.
This would appear to have been the result of of a simple calculation (58.75 - 58.72). I have come across this kind of thing before but not for years. What causes this kind of minute discrepancy? The spreadsheet itself does not appear to contain any 'odd' values - i.e. they appear to be presented and held to 2 decimal places. My CDbl fix is a satisfactory workaround but it worries me when else this kind of 'unpredictable' problem could crop up.
This has been working for months no problem but this morning it crashed with a SQL 'Multi-step operation generated errors' message. This error usually crops up when the database field format is not appropriate to accept the incoming data. The offending database field was defined as decimal(12,4) but the value the program was trying to put into it was 3.00000000000011E-02. As soon as I used the CDbl function to convert, it ran through OK.
This would appear to have been the result of of a simple calculation (58.75 - 58.72). I have come across this kind of thing before but not for years. What causes this kind of minute discrepancy? The spreadsheet itself does not appear to contain any 'odd' values - i.e. they appear to be presented and held to 2 decimal places. My CDbl fix is a satisfactory workaround but it worries me when else this kind of 'unpredictable' problem could crop up.