Solved

How to trim spaces in captured data on some fields ?

Posted on 2009-07-15
8
293 Views
Last Modified: 2012-05-07
HI

We have imported some data to an access table but it seems that some fields have some spaces at right and left side.

I wonder if there´s an access function that could trim those spaces.

Thanks in advance.
0
Comment
Question by:dimensionav
  • 5
8 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 250 total points
ID: 24866352

Trim(yourFieldName)

mx
0
 
LVL 4

Assisted Solution

by:mysteriousguy
mysteriousguy earned 250 total points
ID: 24866353
There are 3 functions doing this.
LTrim trims the left spaces
RTrim trims the right spaces
Trim trims left and right spaces

So you could update yout table like this:
UPDATE table set column = Trim(column)

http://www.techonthenet.com/access/functions/string/trim.php
http://www.techonthenet.com/access/functions/string/ltrim.php
http://www.techonthenet.com/access/functions/string/rtrim.php
0
 
LVL 75
ID: 24866363
For example ... using an Update query:

UPDATE Table1 SET Table1.FIELD1 = Trim([FIELD1]), Table1.FIELD2 = Trim([FIELD2]), Table1.FIELD3 = Trim([FIELD3]);


mx
0
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
LVL 75
ID: 24866457
I posted the correct answer first - followed by an example.

mx
0
 

Author Comment

by:dimensionav
ID: 24866500
I´m very sorry DatabaseMX, I just saw the mysteriousguy example first, I haven´t noticed your next example after trying mysteriousguy one.

What would you like I do ?
Regards
0
 
LVL 75
ID: 24866506
Click the Request Attention button ... the mods will help you.

thx
0
 
LVL 75
ID: 24906447
thx.
Appreciate this.

mx
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Some sers suddenly getting error popup msg 28 87
Access 2016 5 53
Any Way to Print an Import Spec? 3 29
Attachment field in SQL 3 26
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question