Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
pepe2209
Creator
Creator

delete right part from string and keep left

Hello

I would like to keep te left part of a string value, but the length of the left part is variable. see example:

100023Feb2013

10034Jun2013

2300Jan2012

so i would like to delete the right 7 characters of the string and keep whatever is left. Being:

100023

10034

2300

your help would be much appreciated.

regards Peter

1 Solution

Accepted Solutions
Peter_Cammaert
Partner - Champion III
Partner - Champion III

How about this (I'm assuming you want to apply this in your load script)?

... left(SourceField, index(SourceField, right(SourceField, 7))) AS LeftPart ...

Peter

View solution in original post

6 Replies
Peter_Cammaert
Partner - Champion III
Partner - Champion III

How about this (I'm assuming you want to apply this in your load script)?

... left(SourceField, index(SourceField, right(SourceField, 7))) AS LeftPart ...

Peter

Anonymous
Not applicable

Peter

Would something like this help ?

     = left ( '100023Feb2013' , len( '100023Feb2013' ) -7 )

Best Regards,     Bill

jvishnuram
Partner - Creator III
Partner - Creator III

Hi Peter,

Try this replace('100023Feb2013',Right('100023Feb2013',7),'')

Not applicable

Hi,

A way to do it:

Left(StringField,Len(StringField)-7)

Regards

alexandros17
Partner - Champion III
Partner - Champion III

mid('10034Jun2013', 1, len('10034Jun2013')-7)

pepe2209
Creator
Creator
Author

Thanks for the quick response everybody.

i've used Peter Cammaert's solution

thanks again