Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 19th, 2007, 01:05 PM
Joey Martin
Guest
 
Posts: n/a
Default Delete until end of line

Sample:
sql="select * from table order by id"

How do I look at the query statement and remove all the characters
starting with "order by" and remove all remaining characters in that
line?





*** Sent via Developersdex http://www.developersdex.com ***
  #2  
Old April 19th, 2007, 03:45 PM
Subrato
Guest
 
Posts: n/a
Default Re: Delete until end of line

On Apr 19, 7:53 am, Joey Martin <j...@kytechs.comwrote:
Quote:
Sample:
sql="select * from table order by id"
>
How do I look at the query statement and remove all the characters
starting with "order by" and remove all remaining characters in that
line?
>
*** Sent via Developersdexhttp://www.developersdex.com***
You could do a string search and remove everything after the word
order till you encounter the last double quote ..


  #3  
Old April 19th, 2007, 03:55 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default Re: Delete until end of line

Joey Martin wrote:
Quote:
Sample:
sql="select * from table order by id"
>
How do I look at the query statement and remove all the characters
starting with "order by" and remove all remaining characters in that
line?
>
>
Two techniques:
1. InStr() combined with Left()

sql=Left(sql, InStr(sql,"order by") - 1)

2. Regular Expression
left as exercise for other posters

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles