Hi All,
Can anyone provide solutions for the issue:
Column Values=ASP-000123 or it can be
AMP-000123 or it can be
BP Initial-000123 or it can be
BP Restated-000123
Required=>000123
I need to extract ASP if the value is (ASP-000123) But answer should come 000123
I need to extract AMP if the value is (AMP-000123) But answer should come 000123
I need to extract BP Initial if the value is (BP Initial-000123) But answer should come 000123
I need to extract BP Restated if the value is (BP Restated-000123) But answer should come 000123
How to do this?
I tried by using substring and Trim function but Trim function removes single character only. I need to remove set of characters or string of values.
Could please anyone provide solution as will consider your help as Great
Thanks,
Yogeswari.
From your sample data it looks like the number you're looking for is always preceded by "-". You should be able to FIND that character and use that as the starting point for your substring. It depends on what platform you're using, but if you're using SQL server you probably want to use something like CHARINDEX.
C
If the numbers you want are always 6 characters and depending on what DB you are using you should be able to just do a...
right([CommonValue], 6)
You can also try...
substring([CommonValue], -6)
Hi All,
Thank you so much for your responses :). I tried by using Substring and Trim function.
Its works fine.
Thank you all your responses. Will get back to you if anything i struggle.
Thanks,
Yogeswari.