format this in a query

icemonster

Registered User.
Local time
Yesterday, 21:45
Joined
Jan 30, 2010
Messages
502
hi.

i have asked and people have the same question as this but i still have not found a good answer for this one. here's my situation.

i need to format a set of characters, whether it is 123456789AB or just 123456789A or AB123456789, how would i format it in a query so that it would be like this?

123-45-6789A
123-45-6789AB
AB1-23-456789

? anyone. please and thank you.
 
Left([YourField],3) & "-" & Mid([YourField],4,2) & "-" & Mid([YourField],6)
 

Users who are viewing this thread

Back
Top Bottom