This is a migrated thread and some comments may be shown as answers.

Search/Filtering on Decimal Field

1 Answer 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 19 Jan 2018, 04:57 PM

Greetings - was looking for some help with this error I'm seeing:

"The binary operator Equal is not defined for the types 'System.Decimal' and 'System.String'."

I have a field that is a decimal type in the database and using this filter to try to search it:

restFilter.filters.push({ field: "OrderNumber", operator: "eq", value: searchValue });

I am passing it a value of "001" so it is numeric. Not sure why it's not working?

Could someone help - thanks!

Craig

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 23 Jan 2018, 11:17 AM
Hi Craig,

Similar errors to that one have been reported in the EntityFramework Core repository. Please update to the latest EntityFramework Core version and see how the behavior changes. 

With that said, have in mind that 001 is not a valid numeric value. If there are leading zeroes then most likely this is stored as string in the data source. If you would like to execute numeric-related operations with the field please make sure that it is parsed correctly when reading it from the database. 


Regards,
Viktor Tachev
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Craig
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or