Wildcard for numbers in query

Hello! I have a query that only works if I have the codag value - numeric - (send by drop down menu).

I would like the menu, if I don’t select anything in particular, to show me the complete query
I don’t know how to set the wildcard value (I refer to below post, which I had done for a similar problem but with a text field and ‘%’)

Can anyone help me?
Thanks

Hey @markoax21,

If I understand correctly, you need to ignore the post value of the select input if it is not set.
Is this right?
If yes, then use the toggle condition inside your Query builder conditions (see example below)

Hi @famousmag!
I have to do custom query, can’t make simple. so this is the code I wrote:

SELECT demil.isprev.data AS dataisprev, demil.isprev.codice AS codisprev, demil.isprev.note1, demil.isprev.numdoc, demil.conti.[desc] AS contidesc, demil.isprev.finito, demil.isprev.sincronizzato, demil.utenti.[desc] AS descagente
FROM ((demil.isprev INNER JOIN demil.conti ON demil.conti.codice = isprev.codice) INNER JOIN demil.utenti ON demil.conti.codag = demil.utenti.codag)
WHERE demil.isprev.codag = :P1 /* {{$_GET.agentifrm}} */ AND demil.isprev.finito = 1
ORDER BY isprev.numdoc DESC
:P1   {{$_GET.agentifrm}}

I need that

demil.isprev.codag = :P1 /* {{$_GET.agentifrm}} */

give me all values (something like % for text) if I don’t select a specific value in dropdown menu.

I solved changing the field type (set as nvarchar) and making a query with ‘LIKE’ instead of ‘=’

2 Likes