Discussion:
Query - Using Like in same fields more than once
(too old to reply)
Confuser
2010-08-29 13:53:03 UTC
Permalink
Hi,

Any idea how to build be low query in Ax query?

Select * from InventTable
where ItemName like "*light*"
&& ItemName like "*bulb*"

Thanks in advance.
unknown
2010-08-30 17:44:03 UTC
Permalink
You just need to separate them with a comma. Like this:

Query q;
QueryBuildDatasource qbds;
QueryBuildRange qbr;
;

q = new Query();
qbds = q.addDataSource(tablenum(InventTable));
qbr = qbds.addRange(fieldnum(InventTable, ItemName));
qbr.value("*light*, *bulb*");
--
Mathieu Vaillancourt
http://vaillancourtm.blogspot.com
Post by Confuser
Hi,
Any idea how to build be low query in Ax query?
Select * from InventTable
where ItemName like "*light*"
&& ItemName like "*bulb*"
Thanks in advance.
Confuser
2010-08-31 01:17:04 UTC
Permalink
Hi Mathieu,

Thanks for the reply. Just found the solution and yours reply is close to
it. It will provide an OR condition instead of AND condition. It shall be
using below value to fulfill the AND condition. Anyway thanks for the help.

qbr.value("*light*bulb*, *bulb*light*");
Post by unknown
Query q;
QueryBuildDatasource qbds;
QueryBuildRange qbr;
;
q = new Query();
qbds = q.addDataSource(tablenum(InventTable));
qbr = qbds.addRange(fieldnum(InventTable, ItemName));
qbr.value("*light*, *bulb*");
--
Mathieu Vaillancourt
http://vaillancourtm.blogspot.com
Post by Confuser
Hi,
Any idea how to build be low query in Ax query?
Select * from InventTable
where ItemName like "*light*"
&& ItemName like "*bulb*"
Thanks in advance.
Loading...