Hello all,
I’m trying to do a query with two variables. the goal is the end user can select what filter wants to use.
Two variables configured as TEXTBOX: V_PostalCode , V_City
SELECT *
FROM your_table
WHERE (postal_code = $V_PostalCode OR city = $V_City)
AND deleted = 0
If I type on V_PostalCode it works as expected, but if I type on V_City does not work. if i break that query in two queries it works.
SELECT *
FROM your_table
WHERE postal_code = $Var_PostalCode
AND deleted = 0
or
SELECT *
FROM your_table
WHERE city = $V_City
AND deleted = 0
what am I doing wrong?