Fine
Kindly try with this expression
—hope we have the datatable ready named dt
So in the assign activity the expression to be used is dt = dt.Select(“[Areal] >= ‘300000’ AND [Areal] <= ‘400000’ “ ).CopyToDatatable()
Yah if the range is dynamic then we can mention the variable in this expression so that the variable can be passed with dynamic values
Like this dt = dt.Select(“[Areal] <= ‘ “ + firstrange.ToString + “ ’ AND [Areal] >= ‘ “ + secondrange.ToString + “ ’ “ ).CopyToDatatable()
Aaha
I miss placed the operators
I changed in the previous comment
The expression would be like this dt = dt.Select(“[Areal] >= ‘300000’ AND [Areal] <= ‘400000’ “ ).CopyToDatatable()
Still you haven’t changed the expression buddy
Sorry that was my fault
This is the expression dt = dt.Select(“[Areal] >= ‘300000’ AND [Areal] <= ‘400000’ “ ).CopyToDatatable()
No worries buddy
There should be no space between > = it should be like >= and similarly for <= applies same. it should not be like < =
Where in the expression you could be able to see the red curved line next to [Areal] in the beginning of the expression. that implies the same
As there is space between the operators > and = and also in < and = we are getting the error
Mention without any space
Like
=
<=
and kindly dont copy this and paste, that might errorout sometimes, type this expression with the field @Mariafig
It seems the Areal column format is not numeric. You may have to remove the spaces before applying a filter. Use any method to remove spaces (For Each loop on the datatable and replacing spaces with null is an option). Once the spaces are removed you can apply the filter.
Perhaps you should convert cell value to numeric (as mentioned @midhunsug661 ) and compare as Int32 because string comparition differ from numeric comparition. For example “4000” is larger than “300000” by string comparition.
So can you try the following?
dt=dt.AsEnumerable.Where(function(r) CInt(r("Areal").ToString.Replace(" ",""))>=300000 And CInt(r("Areal").ToString.Replace(" ",""))<=400000).CopyToDataTable
@Mariafig@Palaniyappan The reason why the error comes in the box is because you have copied the syntax from the forum. Just write the double quotes manually from the keyboard and the issue will be solved.