Solved

Delete spaces from field

Posted on 2006-06-27
2
238 Views
Last Modified: 2011-10-03
I need to be able to run a query that deletes all spaces contained within a field.  The table is tblSymbol and has a field symCode.  

Field symCode contains a mixtureof alpha characters and spaces.  I need to delete all spaces from within the field.  lets say I have someting like

AA B
CD R
F GG
G H D
FFD (space) (space) etc

I need to end up with

AAB
CDR
FGG
GHD
FFD (with no following spaces)  in fact no following spaces for any of the symbols in the field.

need a quick solution here, thanks

Any suggestions
thanks
0
Comment
Question by:sarahgal
2 Comments
 
LVL 16

Accepted Solution

by:
GreymanMSC earned 500 total points
Comment Utility
Use the following sql statement to update the table

  Update tbltblSymbol set symCode=Replace(symCode, " ", "") where InStr(1, symCode, " ")>0;

Use the following to simply retrieve the values stripped of spaces,

  Select Replace(symCode, " ", "") as symCodeDespaced from tbltblSymbol;
0
 

Author Comment

by:sarahgal
Comment Utility
the update statement works perfectly.  thanks GreymanMSC.

appreciate the quick response....
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now