Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Insertion caractères dans un champ

Bonjour,

Je souhaiterais pouvoir insérer des "tirets" dans un champ d'une de mes tables.

Voici le type de données présentes actuellement: "BA193DC"

Voici ce que je souhaiterais obtenir: "BA-193-DC"

Je ne sais vraiment pas comment procéder... Merci d'avance !

Marie.

Labels (1)
1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Try With:

suppose your field name is myField:

Load

....

Left(myField,2) & '-' & Mid(myField,3,3) & '-' & Right(myField,2) as myNewField

Let me know

View solution in original post

4 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Try With:

suppose your field name is myField:

Load

....

Left(myField,2) & '-' & Mid(myField,3,3) & '-' & Right(myField,2) as myNewField

Let me know

Not applicable
Author

It's perfect ! Thanks ! 

I have an other interrogation (maye quite the same..):

My field is "VBA193DC" ,

And I would like to have : "BA-193-DC"

So realise the same manipulation than before but, in addition, remove the "V" ...

alexandros17
Partner - Champion III
Partner - Champion III

use Len() function, so if len(MyField) = 7 use the code I have yet written otherwise use this:

Left(Right(myField,7),2) & '-' & Mid(Right(myField,7),3,3) & '-' & Right(Right(myField,7),2) as myNewField

Not applicable
Author

Merci beaucoup. C'est exactement ce que je souhaitais!

Bonne journée.