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)...
0
Comments
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
So, what regarding my question?
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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
UK-NP19 4PU
RO-061072
NL-4693 RE
DK-4600
DE-48499
KO-135-820
SE-141 75
ES-07011
If you have dashes in your number then you need to follow the advise given by the above poster and create a temp table.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
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.
Thanks, BUT right code is:
gcodPostCode := DELCHR("rec.Post Code",'<>','ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,;/');
Sorry, i don't try this out
If this was the solution, maybe you can mark the topic as fix.
Thanks.
came
This will remove all the non numeric characters.