SQL statement in lookup field returns wrong result to field
Posted: Tue Apr 02, 2013 8:57 pm
Hi,
I have a lookup field that opens a form that displays results from the following SQL statement:
But, no matter which row you select, it always returns the first one to the form. Now, when I change the OR to an AND
it works fine.
Keeping the OR operator, I tried changing the field and the criteria for the second LIKE operator, not like that should make a difference, and not surprise, it didn't.
Any idea what's going on? Or what sort of workaround I could use?
Thanks,
Cassidy
I have a lookup field that opens a form that displays results from the following SQL statement:
Code: Select all
SELECT * FROM product_points WHERE pp_code LIKE 'AC%' OR pp_code LIKE 'BD%' GROUP BY pp_code
Code: Select all
SELECT * FROM product_points WHERE pp_code LIKE 'AC%' AND pp_code LIKE 'BD%' GROUP BY pp_code
Keeping the OR operator, I tried changing the field and the criteria for the second LIKE operator, not like that should make a difference, and not surprise, it didn't.
Any idea what's going on? Or what sort of workaround I could use?
Thanks,
Cassidy