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!

Putting all the data that occurs before a BRACKET into a STRING?

Status
Not open for further replies.

ftpdoo

Programmer
Aug 9, 2001
202
GB
Hi,

I've got a text box called "txtSQLTemplate" while contains an SQL Statement. What I want to do is to extract all the data the occurs before the first opening bracket.

txtSQLTemplate contains:
INSERT INTO myTable VALUES ( WorkOrder, Bla, bla, bla )

So I want a string to contain everything up to the first bracket: "INSERT INTO myTable VALUES ("

Thankx,
Jonathan
 
Jonathan,

How about

dim iPos as integer
sim sSQL as string

sSQL = "INSERT INTO myTable VALUES ( WorkOrder, Bla, bla, bla )"

ipos = InStr(1, sSQL, "(")

sSQL = left$(sSQL,ipos)

That should do it.

Nick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top