?
Solved

string remove character if ' '

Posted on 2012-03-11
2
Medium Priority
?
214 Views
Last Modified: 2012-06-21
I need to check value in a column and check if there is an empty space as the first character.
If it is I would like to remove the first character. How is best to do that?
For example. Column MyColumn  value=" One". It has an empty space.  It should be value="One".
0
Comment
Question by:johnkainn
  • 2
2 Comments
 
LVL 9

Assisted Solution

by:macarrillo1
macarrillo1 earned 2000 total points
ID: 37707382
try :

select ltrim(MyColumn)
from Table
0
 
LVL 9

Accepted Solution

by:
macarrillo1 earned 2000 total points
ID: 37707390
Actually, you said that you wanted to change the value so it should be an update statement:

update tablename
set MyColumn=ltrim(MyColumn)
from tablename A, tablename B
where A.ID=B.ID
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

850 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