Remove only the last comma security!
3 posts by 3 authors
Garry
12:27 AM (20 hours ago)
Hi
I need to remove or replace with "" only the last comma in a field
from: Bill, John, Matt, Fred,
to : Bill, John, Matt, Fred
Any help would be appreciated, have tried Replace([Field],"*,","") but no
good
Cheers
Click here to Reply
8:40 AM (12 hours ago)
Puppet_Sock You might find the function InStrRev() helpful. In combination with the functions Len(), Left(), and Right(), you may be able to do what you need. Socks
John W. Vinson
8:41 AM (12 hours ago)
On Wed, 24 Apr 2013 08:27:50 +0100, "Garry" <
redwin...@btconnect.com>
wrote:
>Hi
>
>I need to remove or replace with "" only the last comma in a field
>
>from: Bill, John, Matt, Fred,
>
>to : Bill, John, Matt, Fred
>
>Any help would be appreciated, have tried Replace([Field],"*,","") but no
>good
>
>Cheers
>
Replace doesn't recognize wildcards, only literal text.
I'd suggest updating the field to
Left([fieldname], Len([fieldname]) - 1)
where [fieldname] LIKE "*,"
since the LIKE operator does use wildcards.
--
John W. Vinson [MVP]
Microsoft's replacements for these newsgroups:
http://social.msdn.microsoft.com/Forums/en-US/accessdev/
http://social.answers.microsoft.com/Forums/en-US/addbuz/
and see also
http://www.utteraccess.com