Closed AlexanderTunick closed 5 years ago
Hi @AlexanderTunick, I am wondering this error is thrown from SQL server-side. Is this "CAST(dosd.value as DECIMAL(10,3)" the place causing the error. If you are sure that dosd.value is a decimal type data, I found a page may be related to this issue. https://www.mssqltips.com/sqlservertip/4008/handling-error-converting-data-type-varchar-to-numeric-in-sql-server/ Maybe you check this link, see if this helps.
Hi @MichaelSun90! Thank you for your response. I guess the error is called because of these types of data in the column. It's real garbage. It may occur because of "3:00:00 PM". Don't you know how to handle this case?
2017
2017
2017
2017
3:00:00 PM
7:45:00 AM
0
0
0.47
1.16
0.81
0.58
Resolved. For anyone who has struggled, see: https://stackoverflow.com/questions/57027840/error-converting-data-type-varchar-to-numeric-in-table-with-different-data-types/57027851#57027851
Hi! Stuck on the issue with tedious due to this error. Spent already almost half of the day to resolve it but not successfully.
I user knex.js query builder for making queries to DB. I send exactly the same query that works in DataGrip IDE. The only specificness of this query that in a condition I use a column with decimal values.
My Query: class.js
test.js
Receiving error (with consoled query and bindings from knex)