I need to chek format of a field.If the format of the field is 99-999-9999 then one condition should satisfy.
Please suggest how to check the field format.
problem in format checking
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 20
- Joined: Mon Dec 11, 2006 10:57 am
- Location: Pune
Re: problem in format checking
Try using combination of following functions
1. Trim
2. Length
Trim function will return digits before occurance delimiter.
e.g. 99-999-9999
2 digits after first ocurance of delimiter -.
1. Trim
2. Length
Trim function will return digits before occurance delimiter.
e.g. 99-999-9999
2 digits after first ocurance of delimiter -.
Mayur Dongaonkar.
First do a count(In.Col,"-") and check if it is 2. Then len(field[In.Col,"-", 1) and len(field[In.Col,"-", 2) should be 2 and 3 respectively. And then len(field[In.Col : "-","-",3) should be 4. Probably you can check to see if it is a number or not by using Alpha function. It returns a 1 if it is purely alphabetic. So Alpha(field(In.Col, "-", 1)) <> 1, Alpha(field(In.Col, "-", 2)) <> 1 and Alpha(field(In.Col : "-", "-", 3)) <> 1 should all be true.