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!

Select records where there are spaces in the text

Status
Not open for further replies.

jcfrasco

IS-IT--Management
Apr 27, 2001
89
US
Hello,

I am trying to write a select statement that will show me how many records in a table have spaces in the middle of the text. The field is for entering the last name of users but the customer has used it for entering other data that was relevent to them and not the data is corrupted. I have used the wildcard brackets to search for special characters and that works perfectly, but now I must also find which records have spaces (not leading or trailing) so I can exclude those when I transfer good records to a new table.

Thank you for any assistance with this problem.

jcfrasco
 
[tt][blue]
Select *
From Table
Where RTrim(LTrim(ColumnName)) Like '% %'
[/blue][/tt]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
George,

Thank you for your quick reply and I feel a little foolish to not have figured that out. I was looking for the more complicated solution and didn't even think of trying that.

Very much appreciated!

jcfrasco
 
You're welcome.

Life should only be as complicated as it has to be. [smile]

-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top