Home All Groups Group Topic Archive Search About


Author
15 Jun 2006 1:11 PM
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

Author
15 Jun 2006 1:15 PM
Aaron Bertrand [SQL Server MVP]
for i = 0 to ubound(arrSearch)
Show quote
    response.write i & " = " & arrSearch(i) & "<br>"
next


"peashoe" <peas***@yahoo.com> wrote in message
news:1150377080.284479.133980@u72g2000cwu.googlegroups.com...
> 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
>
Author
15 Jun 2006 1:27 PM
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~
Author
15 Jun 2006 1:32 PM
Aaron Bertrand [SQL Server MVP]
"peashoe" <peas***@yahoo.com> wrote in message
news:1150378032.153406.112280@i40g2000cwc.googlegroups.com...
> 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.
Author
15 Jun 2006 1:48 PM
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~!

AddThis Social Bookmark Button