Filter in report by post code with letters or without.

knaabis
Member Posts: 37
Should I create a filter by post code, but sometimes from beginning is letters, but sometimes not.
How to use in filter only numbers?
I need to find out Customers by post code (for example) NO-2100 and 5010.
For me usable is only numbers like 2100 and 5010 - how to "delete" this "NO-"?
p.s. Sometimes post code will be longer as 4 numbers...
For example:
1) NL-6538 SX
2) SE-113 27
3)...
How to use in filter only numbers?
I need to find out Customers by post code (for example) NO-2100 and 5010.
For me usable is only numbers like 2100 and 5010 - how to "delete" this "NO-"?
p.s. Sometimes post code will be longer as 4 numbers...
For example:
1) NL-6538 SX
2) SE-113 27
3)...
0
Comments
-
It looks like post codes is not a good way to categorize your customers. You need a new field.0
-
I know, but it's the only way to find out result.
So, what regarding my question?0 -
Do you have all the combination of how they appear?0
-
Hi,
maybe you can delete the chars with function "NewString := DELCHR(String[, Where][, Which])" temporaly
http://msdn.microsoft.com/en-us/library/dd354973.aspx
An example gcodPostCode := DELCHR("rec.Post Code","="ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,;/");
After this the variable gcodPostCode has only numbers. You can add more delchars of course.
You can catch the error with if ...
if (DELCHR("rec.Post Code","="ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,;/"))<> "" then
do ....
else
do ...
or
create a temp table of your record, fill it and use it before the loop starts.
or
check your Post Code with ...
if rec."Post Code" in ["A","B","C","D","E","F","G","H","I","J" ......] then
// check if the "Post Code" has any char in the []
else
//all with any char0 -
UK-AL2 1BB
UK-NP19 4PU
RO-061072
NL-4693 RE
DK-4600
DE-48499
KO-135-820
SE-141 75
ES-070110 -
If you are trying to find customer just by number. You can do it this way.
NumberFilter := 123; Customer.reset; Customer.setfilter("Post Code",'*'+format(Numberfilter) + '*'); if Customer.findset then repeat until Customer.next = 0;
If you have dashes in your number then you need to follow the advise given by the above poster and create a temp table.0 -
As far as I remember Navision also understands 'NO-2100'..'NO-4200'. It should filter correctly.
If you can only filter on numbers then normally with this notation addint the country code filter should work to avoid filtering on customers in other countries.0 -
came wrote:Hi,
maybe you can delete the chars with function "NewString := DELCHR(String[, Where][, Which])" temporaly
http://msdn.microsoft.com/en-us/library/dd354973.aspx
An example gcodPostCode := DELCHR("rec.Post Code","="ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,;/");
After this the variable gcodPostCode has only numbers. You can add more delchars of course.
You can catch the error with if ...
if (DELCHR("rec.Post Code","="ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,;/"))<> "" then
do ....
else
do ...
or
create a temp table of your record, fill it and use it before the loop starts.
or
check your Post Code with ...
if rec."Post Code" in ["A","B","C","D","E","F","G","H","I","J" ......] then
// check if the "Post Code" has any char in the []
else
//all with any char
Thanks, BUT right code is:
gcodPostCode := DELCHR("rec.Post Code",'<>','ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,;/');0 -
This will also work
gcodPostCode := DELCHR(rec."Post Code",'=',DELCHR(rec."Post Code",'=','0123456789'));
This will remove all the non numeric characters.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