Filter using more than one fields at a time

smic1983
Member Posts: 27
Hi
Is it possible to filter the data using two fields at a time.
Eg: Where (FieldName1 ="Value1") or (FieldName2 ="Value2")
from the Setfilter and Setrange i can use only one field at a time. Is it any other way is there??????
Regards,
Michael
Is it possible to filter the data using two fields at a time.
Eg: Where (FieldName1 ="Value1") or (FieldName2 ="Value2")
from the Setfilter and Setrange i can use only one field at a time. Is it any other way is there??????
Regards,
Michael
0
Comments
-
-
Michael
did you try this:
MyTable.SETFILTER(Field1, Value1);
MyTable.SETFILTER(Field2, Value2);
works great for me...Best regards,
Denis Petrov.0 -
Denis Petrov wrote:Michael
did you try this:
MyTable.SETFILTER(Field1, Value1);
MyTable.SETFILTER(Field2, Value2);
works great for me...
The main request Michael posted was the word "or"
The codeMyTable.SETFILTER(Field1, Value1); MyTable.SETFILTER(Field2, Value2);
means field1=value1 and field2=value2.0 -
The required filter is 1n effect 3:
Field1=Value1 and Field2=Value2
Field1=Value1 and Fields2<>Value2
Field1<>Value1 and Field2=Value2
At each stage can copy to a temporary table/buffer and present this
But all depends on your requirements and objectives.
Apologies if I've missed the point0 -
No problem, Yes temp table can be used.
He can also use ADO and run the sql statement.0 -
You can also use the MARK function.0
-
Thank U Rashed,
Can u just explain about ADO and how can i use the sql statement in CAL coding. Is it possible to get connection string directly from Navision itself. if its possible please pate sample code here.
With Regards,
Michael S.0 -
Here is a howto to us ADO in NAV.
viewtopic.php?f=5&t=23038&hilit=recordset
And yes you can create the connection string from NAV. Almost all the info is available in session table. I'm assuming you are running on sql. The only you need is a separate login and pw which you can create in a setup 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