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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Trimming spaces in multiple fields within an Update Query 1

Status
Not open for further replies.

SeeWard

Programmer
Mar 21, 2005
89
US
I'm writing an update query that I thought was all figured out, but alas, it's not :(. Could someone out in e-land grant me the proper syntax for updating multiple fields using the Trim function? I've tried all sorts of renditions, but still I'm getting errors.
Thanks.
 
Any chance you could post some SQL code you tried ?
You want something like this ?
UPDATE yourTable
SET yuorField = Trim([yourField])
WHERE yourField Like '* ' Or yourField Like ' *'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
UPDATE

SET
.[Field1],
.[Field2]=
Trim[Field1], Trim[Field2]
WHERE [Field1] IS NOT NULL;

UPDATE

SET
.[Field1] = TRIM([Field1])
SET
.[Field2] = TRIM([Field2])
WHERE [Field1] IS NOT NULL;

 
And this ?
UPDATE

SET [Field1] = Trim([Field1]), [Field2] = Trim([Field2])
WHERE [Field1] IS NOT NULL;

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