MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 11th, 2004, 12:00 PM
golfballtx golfballtx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 6 golfballtx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 49 sec
Reputation Power: 0
Simple text replacement question

I have a field with first names in it, but when I updated it, I didn't notice commas in the field. I'd like to be able to delete the commas only in the field, but I can't figure out how. Thanks in advance for the assistance! I'm running MS Sql 7.0

Reply With Quote
  #2  
Old May 11th, 2004, 05:29 PM
Username=NULL Username=NULL is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: TX
Posts: 249 Username=NULL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 7 h 6 m 42 sec
Reputation Power: 5
Send a message via Yahoo to Username=NULL
not really understanding

You want to delete commas, but in the recent update, the commas were not inserted...so you want to delete commas that you're no longer seeing??

Post a screen shot or sample data of what's in the table if you can.

Reply With Quote
  #3  
Old May 12th, 2004, 11:28 AM
golfballtx golfballtx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 6 golfballtx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 49 sec
Reputation Power: 0
There are commas in the name field that I need to remove.

e.g. "John, K"

I just want it to read "John K"

Reply With Quote
  #4  
Old May 12th, 2004, 11:59 AM
Username=NULL Username=NULL is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: TX
Posts: 249 Username=NULL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 7 h 6 m 42 sec
Reputation Power: 5
Send a message via Yahoo to Username=NULL
sorry, I don't know how to get rid of just one char in a string. I think you can select the parts you want, then reinsert 'em back into the table, then delete the records that have a "," in it...I'll try to script something like that and try to get back to you.

Btw, this reason is a good reason why I like to have 2 seperate fields, 1 for lastname, another for firstname. From there, inserting a comma is cake if needed, but using 1 field w/a comma already in it and, well...this thread is a result. Just for future reference.

In the name field to the right of the comma, is it always a 1 letter initial?

Last edited by Username=NULL : May 12th, 2004 at 12:13 PM.

Reply With Quote
  #5  
Old May 12th, 2004, 12:19 PM
golfballtx golfballtx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 6 golfballtx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 49 sec
Reputation Power: 0
I am using separate fields for first and last names. However, this data comes from a file I'm sent that is generated from a mainframe, so I assume the commas are some sort of separator, but the first name field always has the first name, followed by a comma, and then the middle initial if it exists.

Reply With Quote
  #6  
Old May 12th, 2004, 12:28 PM
swampBoogie swampBoogie is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Jan 2003
Location: Paris Uppland
Posts: 1,775 swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level)swampBoogie User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Weeks 4 Days 16 h 2 m 7 sec
Reputation Power: 37

Reply With Quote
  #7  
Old May 12th, 2004, 01:13 PM
golfballtx golfballtx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 6 golfballtx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 37 m 49 sec
Reputation Power: 0
Thx Swampboogie

I set up a stored procedure that I call from my access database to do this and it works like a charm!

Reply With Quote
  #8  
Old May 12th, 2004, 08:49 PM
Username=NULL Username=NULL is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: TX
Posts: 249 Username=NULL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 7 h 6 m 42 sec
Reputation Power: 5
Send a message via Yahoo to Username=NULL
thx SB...the info in that link will definitely come in handy sometime.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Simple text replacement question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway