How to filter numbers ?

By: Peter S | Asked: 02/14/2023
ForumsCategory: How-toHow to filter numbers ?
Peter S asked 1 year ago

Hey, 

I have a number field that is in my search forum, but I can't get it to search for specific figures. 

Is this filter parameter not right? Please see screenshot.

Thanks!
Peter

Attachments
1 Answers
Victor Font answered 1 year ago
Hi Peter, I deleted your second post since it was identical to this one. The #number parameter is only correct if the parameter name passed in your query string is #number. Even though you use number fields on the front end, their values are stored as text in the database. In fact, all entry fields are. Queries search for text strings. I'm not sure why you are using a hash tag in the variable name. There's no coding reason for it.
Victor Font replied 1 year ago

BTW, sometimes filter logic could be off a little. If I'm reading your filter correctly, this is the logic I see:

( forename = fname AND surname = lname ) OR year like number

In other words, you want it to match either on the full name or year. Is that correct?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right