QueryBuilder is not filtering Numbers correctly
I am using Tablebuilder to display a season_number column from a metadata relationship:
When I am using QueryBuilder to create a filter for this column the filtering is not applied:
See attached screenshot. Please help!
Thanks!
9 Replies
NumberConstraint
is a custom filter? What is the code for that?
Also please add code formatting as shown in #✅┊rulesHi Dennis,
What do you mean by 'NumberContraint is a custom filter'? I am creating the constraint as described here: https://filamentphp.com/docs/3.x/tables/filters/query-builder
Oh, sorry. That part is new to me. Haven’t used that one 😅🙈
Make sure you are actually storing the value in the db as an integer or are applying the appropriate cast to it.
We are doing that, storing the value as an int and cast it as an integer. We are using postgres, can this be causing the issue?
Honestly, i'm not sure. never actually used Postgres
Ok, hopefully, there is someone else who knows what is causing the issue??
Anyone?
I'd say: Try debugging the DB queries and check what the actual query is. (Debugbar or tool of your choice)
ok thanks, I will do that and try to see if there is something wrong.