Discussion:
Remove only the last comma Quries!
(too old to reply)
dan.ashley@abc com
2013-12-10 02:16:30 UTC
Permalink
Michael Lalonde

Dec 7
Note: The author of this message requested that it not be archived. This message will be removed from Groups in 4 days (Dec 14).

x-no-archive: yes

trim perhaps?

Left([Field], Len([Field]) -1)

Michael Lalonde
Sudbury, Ontario
M&J Mining CA

"Garry" wrote in message news:***@bt.com...
- hide quoted text -

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

Apr 24

- hide quoted text -
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
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

Apr 24
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

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
Remove only the last comma
Tony Toews
2013-12-19 02:46:26 UTC
Permalink
Go away. We don't want you here.

Tony
Access Developer
2013-12-30 21:13:55 UTC
Permalink
Post by Tony Toews
Go away. We don't want you here.
Tony
<CHUCKLE> Can't trust anybody posting to a newsgroup on database software
who can't spell "Queries", can you?

--
Larry

Loading...