Filter between two inputs

Hi All,

I want to filter records from a table using two text inputs so they filter between input 1 and input 2.

There used to be a ‘between’ option in the query conditions of Server Connect in DW but not in Wappler.

Can anyone point me in the right direction on how to create such a filter?

Many thanks
CK

There is a between condition in query builder.
What is the db field type you want to filter?

Hi Teodor,

It’s a varchar which I’m guessing is why the ‘between’ option is not showing, on an integer field the ‘between’ is visible.

How in this case then can I filter this field between two inputs. I can’t alter the field type as its a database that’s part of another application?

CK

Between is only available for integer fields, not for strings.

You could try (depending on your data content) value >= input 1 and value =< input 2. But as Teodor mentions, your data field type is wrong for what you are trying to do.

OK, thank you for your help, I’ll try and find another way.

CK

I have created a view using the CAST function in MySQL. The following SQL added an extra field called sent_expr to the results which I was then able to create a view from:
SELECT
CAST(table.field AS UNSIGNED) AS field_expr,
table.*
FROM table

From there I was able to use the >= and =< suggested by Brad on the field_expr, it now being an INT field.

Not sure if this is the right way of doing it but it’s worked…

Thank you all for your help.

CK

1 Like