I have a field in crystal report with the following data:
'605 KL1 - Daniel Steve'
How can i just remove the '605 KL1 - ' and leave the 'Daniel Steve' in the field only?
Characters before '-' could be different, i hope the formula would automatically search for the '- ' and then show everything after it.
views:
69answers:
1
+2
A:
MID
can help here:
MID(my_string, 11) // will print your string from character 11 ("D") forward
And you can combine MID
with INSTR
if you need the display to be dynamic (of course this will only work if your data have a consistent format):
MID(my_string, (INSTR(my_string, "-") + 2))
Adam Bernier
2010-06-07 02:49:48
Is it possible not to fixed the character index? As the characters before "-" could be different. I hope it can search for the '- ' and then show anything after '- '.
WeeShian
2010-06-07 02:59:45
@WeeShian: just added another example to address this additional case.
Adam Bernier
2010-06-07 03:01:57
Thank you so much! It works...
WeeShian
2010-06-07 03:05:05