trim a field

  • Thread starter Thread starter nadesico
  • Start date Start date
N

nadesico

I am having trouble with this simple problem. I have a field that has every
entry ending with a comma. Example,

apple,
plum, pear,
grape, orange, peach,

and basically all I want to do is remove the last comma from each record. I
tried using

Fruit: Left([Field1], instr[Field1], ",")-1)

but this only displayed the first fruit and not the rest if there were more
than 1. Any help would be greatly appreciated.

Thanks
 
IF there is ALWAYS a trailing comma then you can use
LEFT([Field1],Len([Field1])-1)


John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
nadesico said:
I am having trouble with this simple problem. I have a field that has every
entry ending with a comma. Example,

apple,
plum, pear,
grape, orange, peach,

and basically all I want to do is remove the last comma from each record. I
tried using

Fruit: Left([Field1], instr[Field1], ",")-1)

but this only displayed the first fruit and not the rest if there were more
than 1. Any help would be greatly appreciated.

Thanks

If you have more than one fruit in a field, you have a serious design flaw.

Mike
 
Back
Top