I am looking for a quick & simple way of formating a vehicle registration number i.e. SY23 777
k, what is the PATTERN (is it the same every time "AA## ###"?) or is it variable?
i.e. SY23 777
This is the standard format for new registration numbers SY23 777
Some older registrations were formated Y### ### i.e Y563 AAA
And then we get the personalised Plates which could be anything (not realy looking to format these)
mainly I am looking for 3 digits from the right then a space
I have found the RIGHT format but then don't know how to put the space in after the 3rd digit
You could use this calculation;
numberplate = "SY23777" // put the number plate field in here
Left (numberplate ; 4) & " " & Middle(numberplate ; 5 ; Length(numberplate))
Will return the result "SY23 777".
We Know Data
Something along these lines should do the trick and cater for a few variations.
reg = trimall(registrationField ; 1 ; 3);
ln = length ( reg)
ln = 5 ; left ( reg ; 2) & " " & right(reg ; 3) ;
ln = 6 ; left ( reg ; 3) & " " & right(reg ; 3) ;
ln = 7 ; left ( reg ; 4) & " " & right(reg ; 3) ;
) //end let
Hi Rob & Steve
I am new to FileMaker Pro
Do I use your script to create a 'Custom Function' and apply it to my RegNo field or do I use it to create an OnLoad script that checks the RegNo field Format
Sorry to apear thick
keitho wrote: mainly I am looking for 3 digits from the right then a space
Try it this way (attached)?
keitho wrote: And then we get the personalised Plates which could be anything (not realy looking to format these)
How can one tell a personalized plate from the rest?
Thanks to everyone who replied to my query
Using bits of everyones input, I have got a solution, thanks to Michael for showing me where to put the script
Retrieving data ...