Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Remove only the last comma

7 views
Skip to first unread message

Garry

unread,
Apr 24, 2013, 3:27:50 AM4/24/13
to
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


Puppet_Sock

unread,
Apr 24, 2013, 11:40:55 AM4/24/13
to
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

unread,
Apr 24, 2013, 11:41:51 AM4/24/13
to
On Wed, 24 Apr 2013 08:27:50 +0100, "Garry" <redwin...@btconnect.com>
wrote:
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
Message has been deleted
0 new messages