Foundset find mode equivalent of NOT IN (...)

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

Foundset find mode equivalent of NOT IN (...)

Postby steve1376656734 » Tue May 01, 2018 9:02 am

Hi,

Using a foundset in find mode I can search for records which have a field with values that are in an array by using:

Code: Select all
foundset.find();
foundset.myField = ['value1', 'value2', 'value3', ...];
foundset.search();

What is the equivalent code for finding records whose value is NOT IN the array i.e. WHERE myTable.myField NOT IN ('value1', 'value2', 'value3', ...)?

I would normally do this sort of thing using Query Builder as it has much more control over finding records, but in this particular scenario one of the criteria that I am using in the search (not the array based one) is a calculation and I can't find a way to include calculations in a Query Builder select statement.

A solution to either scenario (find mode NOT IN or Query Builder using calculations) would be most appreciated.

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 202
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

Re: Foundset find mode equivalent of NOT IN (...)

Postby rgansevles » Fri May 11, 2018 11:08 am

steve1376656734 wrote:one of the criteria that I am using in the search (not the array based one) is a calculation and I can't find a way to include calculations in a Query Builder select statement


Steve,

Search using find mode ends up doing a query in the database as well, for this reason non-stored calculations are not supported in find mode.
If the calculation is stored (so it is also a db column) you can use it icw the QueryBuilder.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1867
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL


Return to Programming with Servoy

Who is online

Users browsing this forum: Bing [Bot] and 9 guests

cron