September 22, 2014 at 5:20 am
Hi All,
I'm having string values like mentioned below.
String Values:
George, Matt J
Rambla, Tony G.
Expected Output:
George, Matt
Rambla, Tony
I would need to trim the letters like mentioned above. Can anyone help me with this?
I achieved the same in SQL by below query
declare @String as varchar(20) = 'Rambla, Tony G.'
select left(@string,len(@string)+1-charindex(' ',reverse(@string)))
How can I achieve this in MS Access?
September 22, 2014 at 5:34 am
There is a function in Access that does a reverse search on a string - it is InstrRev(). Doing that will let you determine the position of the last space in the string, and then prune it accordingly with the Len() function. That presumes that you always have two spaces in the string, which it appears your T-SQL also does.
Wendell
Colorful Colorado
You can't see the view if you don't climb the mountain!
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy