Last post Sep 23, 2014 06:18 AM by Kevin Shen - MSFT
Sep 22, 2014 07:16 AM|vignesht5|LINK
I'm having string values like mentioned below.
George, Matt J
Rambla, Tony G.
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?
Sep 22, 2014 07:24 AM|Ashim Chatterjee|LINK
Left([Something], Len([Something]) -1)
Sep 22, 2014 07:53 AM|vignesht5|LINK
It doesn't trim the characters like I expected.
Sep 22, 2014 11:18 PM|Kevin Shen - MSFT|LINK
for example you have a table1 ,have a column "name"
the value in the name column is
"George, Matt J"，
“Rambla, Tony G.”
please try the code below:
SELECT Left([name], Len([name]) -2) AS Expr1
Sep 23, 2014 05:53 AM|vignesht5|LINK
on top of this I also have strings like this and this query shoudn't affect those
Sep 23, 2014 06:18 AM|Kevin Shen - MSFT|LINK
It seems that you can not do like that since you have strings like above.
This query will affect all the records.
or you can add where condition to filter these recodes .