How to display S1234567A as SXXXX567A

Elson Khoo

New member
Local time
Tomorrow, 01:19
Joined
May 2, 2013
Messages
4
Dear all,

Can someone advise me how can I display Singapore National Registration Identity Card number in special format

from S1234567F as SXXXX567F?

Thank you
 
Left([SNRICN],1) & "XXXX" & Mid([SNRICN],6)
 
Thank you. It work.

Can explain why Mid([SNRICN],6)? I mean why "6"

Also we change to Right([SNRICN],4) and it work too.
 
Right() can be used instead. Mid is just another way that is useful if the length of the string is not constant..

The second argument of the Mid function is the position of the starting character in the string. An optional third argumentdefines the number of characters to return but it returns the rest of the string if it is omitted.
 

Users who are viewing this thread

Back
Top Bottom