Filtering a number of records

sabzam
Member Posts: 1,149
Dear all,
I need to filter a number of records in two ways, for example:
Contact.SETFILLTER ("No.", 'X') OR Contact.Setfilter (Name, 'XX');
and the result should be where EITHER the No. is X or where the NAME is XX.
Is this possible?
I need to filter a number of records in two ways, for example:
Contact.SETFILLTER ("No.", 'X') OR Contact.Setfilter (Name, 'XX');
and the result should be where EITHER the No. is X or where the NAME is XX.
Is this possible?
0
Comments
-
This should do the trick: Contact.SETFILLTER ("No.", '%1|%2', 'X', 'XX');0
-
@Maximus: put on your glasses
1 filter is with "No.", the other with "Name".
@sabzam:
You can't do it in one run.
You need to put the first filter and loop the the records, putting them in a temptable. Then you put the second filter and you loop the records and add them to the temptable.
After that, you loop the temptable with filtering and you have all records.
It is also possible to use MARKS, but for performance-reasons (specially on SQL) it is better to avoid MARKS.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Hi Sabzam,
Sorry Maximus its not that simply. You have two options here that I can think of. One is to have two record variables and filter down both. Then insert into a third temp record variable.
The second suggestion is to add a field which combines No. and name and filter on the new field as Maximus suggests0 -
Let's put it in another way. Is it possible to compare a table with a temporary table. Practically if I have got records no. 2, 3 and 7 in a temporary table, I want to have filtered these records in the actual (real) table.
IN SQL this would be something like
Select [No_] from [Customer] where [No_] in (Select [No_] from Vendor)0 -
Hi Sabzam,
You would to code this with MARK and select MARKEDONLY which can be slow. If your temp table is on the customer table then you can select directly from the temp. table.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions