NQ operator not returning results in EncodedQuery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 03:49 AM
Hi All,
I have a below table structure Parent table and m2m table for customers having reference to parent table.
Parent table : u_serte
Relationship Table : u_m2m_companies_sertu
Now I have all records on Parent table and there are few records which have one to many relationships with m2m table, ex of relationship is one to many where records on parent table can have multiple customers mapped to them.
If a customer is there then we have a field customer restricted which is set to true and if no customer then this is set to false.
Now when I go to raise a request and select a customer , so now the result should show all the records from parent table where customer is there and all the records where there is no customer.
I have written below query:
"u_tem=SR Day^u_active=true^JOINu_serte.sys_id=u_m2m_companies_sertu.u_serte!u_company=" + comp + "^NQ" + "u_active=true^u_tem_type=SR Day^u_customer_restricted=false" + "^EQ";
No matter what order I try , records returned are always those records where there is a relationship established with customer. Both encoded queries work fine when executed individually but the moment I add OR condition non customer records are never returned.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 04:07 AM
Hello,
Can you use the below code in the encoded query:-
"u_tem=SR Day^u_active=true^JOINu_serte.sys_id=u_m2m_companies_sertu.u_serte!u_company=" + comp + "^NQu_active=true^u_tem_type=SR Day^u_customer_restricted=false";
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 04:13 AM
Tried this version of query with just u_active=true , it returns 10 extra records only where as it should return atleast 1000 records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 04:22 AM
Can you paste some screenshot it would be easier to assist.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2023 05:25 AM
By screenshot you mean screenshot of the result returned from above query or query's screenshot.
Also I tried just concatenating by adding queries in 2 variables and then executing them then also it didn't worked out.