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!

Removing Blanks from Text Field 1

Status
Not open for further replies.

JHHPavel

Technical User
Jul 18, 2003
29
US
I imported some data into an Access table but one of the fields is goofed up. It's supposed to be a diagnosis code but for some reason it came out with random blanks in the field. For example, "abcde" might be "ab cde" one time and "a bc de" another time. I asked if they could re-run without the blanks but the people I'm getting the data from are not too computer literate so this is as good as it will get.

Is there a simple command, like "compress", that squeezes all of the blanks out of a field? I could write a series of instr queries to break apart on blanks and recombine the parts, but it seems like there should be an easy way to do this.

Thanks in advance for any help.

Paul
 
run an update query
assume your table is "tblA" your field is "myField"

UPDATE tblA SET tblA.myField = Replace([myField]," ","");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top