If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Delete a Substring

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-30-03, 12:18
reb1577 reb1577 is offline
Registered User
 
Join Date: Dec 2003
Posts: 3
Red face Delete a Substring

Good morning,

I need to delete the first ten characters from a field, I don't know how to write this query to allow me to do so.
Reply With Quote
  #2 (permalink)  
Old 12-30-03, 12:27
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
update table
set COLUMN = LTRIM(NAME, SUBSTR(COLUMN, 0, 10));
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Reply With Quote
  #3 (permalink)  
Old 12-30-03, 12:34
reb1577 reb1577 is offline
Registered User
 
Join Date: Dec 2003
Posts: 3
UPDATE conitemdescrip
SET descrip= LTRIM(descrip,SUBSTRING(descrip,0,10));

Msg 174, level 15 State 1
the function 'ltrim' requires 1 argument


Suggestions?
Reply With Quote
  #4 (permalink)  
Old 12-30-03, 12:43
r123456 r123456 is offline
Registered User
 
Join Date: Sep 2003
Location: The extremely Royal borough of Kensington, London
Posts: 778
You are using MS SQL Server 2000.

update table
set column = Right(column, Len(column) - 1)

- From Visual Basic
__________________
Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.
Reply With Quote
  #5 (permalink)  
Old 12-30-03, 12:57
reb1577 reb1577 is offline
Registered User
 
Join Date: Dec 2003
Posts: 3
No, I am using
SQL 6.5...
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On