I need to check two field filters condition by and condition in the Query Page.
Example
Sno | Product | Cost | Qty |
1 | A | 100 | 5 |
2 | B | 200 | 6 |
3 | C | 0 | 0 |
4 | D | 900 | 10 |
Filter by = (Cost != 0 and Qty != 0)
We want the result is
Sno | Product | Cost | Qty |
1 | A | 100 | 5 |
2 | B | 200 | 6 |
3 | C | 0 | 0 |
4 | D | 900 | 10 |
Remove to Sno - 3 item data
Hi Thiran,
to do so you have to write it like this in the query filter
var MyQuery: Query "You Query Name"; begin MyQuery.SetFilter(Quantity,<>,0); MyQuery.SetFilter(Discount,<>,0); MyQuery.Open; while MyQuery.Read do begin // populate the temp table end; Myquery.Close; end;
query 50100 "Your Query Name" { QueryType = Normal; elements { dataitem(C; Customer) { column(Customer_Number; "No.") { } dataitem(SL; "Sales Line") { DataItemLink = "Sell-to Customer No." = c."No."; SqlJoinType = InnerJoin; DataItemTableFilter = Quantity = filter(<> 0), Discount = filter(<> 0); column(Qty; Quantity) { } } } } }
I need to check two fields.. with and condition
example:
if (Quantity not qual 0 and discount not qual 0) then show the data
Hi Thiran,
You can either filter the query like this
var MyQuery: Query "You Query Name"; begin MyQuery.SetFilter(Quantity,<>,0); MyQuery.Open; while MyQuery.Read do begin // populate the temp table end; Myquery.Close; end;
or you can also add filters dynamically by using in Query Designer, as shown in the example on this Microsoft Learn page:
query 50100 "Your Query Name" { QueryType = Normal; elements { dataitem(C; Customer) { column(Customer_Number; "No.") { } dataitem(SL; "Sales Line") { DataItemLink = "Sell-to Customer No." = c."No."; SqlJoinType = InnerJoin; DataItemTableFilter = Quantity = filter(<> 0); column(Qty; Quantity) { } } } } }
learn.microsoft.com/.../devenv-query-filters
I hope it helps
Regards
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156