Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with TRIM function 2

Status
Not open for further replies.

osjmgr

Technical User
Apr 22, 2005
6
US
Hello:

I have a field where the data has single quotation marks on each side of it (ex. '79-45-09'). I would like to trim the quotation marks off using an update query.

I tried the following:

(Trim(Left([AgentNo],1)))

but it did not work. Any ideas?
 
Try replace the value with:
Mid([AgentNo],2,Len([AgentNo])-2)
You might want to test this expression in a select query prior to doing a mass update of your table.

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
UPDATE yourTable
SET AgentNo = Mid(AgentNo, 2, Len(AgentNo) - 2)
WHERE AgentNo Like [tt]'''*'''[/tt];

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top