how to filter two fields
Vazid_490
Member Posts: 52
Record.SETRANGE(Field [,FromValue] [,ToValue])// this is the setrange functon syntax
ZIPCGRec.SETRANGE("Post Code",ZIPCGRec."From Zip",ZIPCGRec."To Zip");//this is my form syntax
here post code is a field not in ZIPCGRec table....is my code is correct or wrong
ZIPCGRec.SETRANGE("Post Code",ZIPCGRec."From Zip",ZIPCGRec."To Zip");//this is my form syntax
here post code is a field not in ZIPCGRec table....is my code is correct or wrong
0
Answers
-
ZIPCGRec.SETFILTER("Post Code",'%1|%2',ZIPCGRec."From Zip",ZIPCGRec."To Zip")
It will take just two filters.Thanks
Blog - rockwithnav.wordpress.com/
Twitter - https://twitter.com/RockwithNav
Facebook - https://facebook.com/rockwithnav/0 -
Thank you,
but it print only table first value.this code is didn't filter0 -
If "Post Code" is not a field in the ZIPCGRec table you'll get a compilation error.ZIPCGRec.SETRANGE("Post Code",ZIPCGRec."From Zip",ZIPCGRec."To Zip");//this is my form syntax
here post code is a field not in ZIPCGRec table....is my code is correct or wrong
It is somewhat suspicious that you use values from the same table/record as filter parameters on which you set the filter.
How did you retrieve the records?but it print only table first value.this code is didn't filter
in your code you're setting a filter on one filed using two filter parameters. Is that what you need or do you need the opposite: finding the record with "From Zip" <= "Post Code" <= "To Zip"?Vazid_490 wrote:how to filter two fields0 -
hi, please describe in detail what you need, what you want to do. please describe the meanings of the variables post code, from-zip, to-zip.best regards
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.7K 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
- 324 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


