split question

P

peashoe

Can anyone help me with a simple split problem. I've never done it
before and I have no clue.

I have value sSearch = Lastname Firstname

I need to split it into two separate field:
sLast = Lastname
sFirst = Firstname

I tried
arrSearch = split(sSearch, " " )
but how do I actually get the values?

thanks in advance for your help
Lisa
 
A

Aaron Bertrand [SQL Server MVP]

for i = 0 to ubound(arrSearch)
response.write i & " = " & arrSearch(i) & "<br>"
next
 
P

peashoe

thanks Aaron,
but I don't need to display the data. I just need to grab it so I can
do a sql select to get other data. Therefore, I need to actually have
two values:

sLast and sFirst...

Make sense?
~L~
 
A

Aaron Bertrand [SQL Server MVP]

peashoe said:
thanks Aaron,
but I don't need to display the data. I just need to grab it

Okay, so don't response write, I was just showing you how to quickly see the
data after the split.
 
P

peashoe

the problem was I didn't know how to do it - but I found the answer on
here anyway:

arrSearch = split(sSearch, " ")

this is what I didn't know how to do...
sLast = arrSearch(0)
sFirst = arrSearch(1)

Thanks~!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top