?
Solved

Select to right of &

Posted on 2006-11-14
4
Medium Priority
?
631 Views
Last Modified: 2008-03-04
HI folks.

I've got a field in my db that as too many values in it, and I need to split it up.  The character inserted that indicates the split is "&".

For example...

530903356&05/2007&999&&Felix+Nemitz

The first set of numbers is no set length.
The second set should always be the same
The third set is 3 characters
The final set is a name.

I want to split them like this

Num = 1st set
date = 2nd set
secret = 3rd set
Name = Last set

How can I do this with VBscript???

Thanks
0
Comment
Question by:ClassyLinks
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 31

Accepted Solution

by:
alorentz earned 2000 total points
ID: 17939308
Then split it with split function.

<%
val = "530903356&05/2007&999&&Felix+Nemitz"
arr = split(val, "&")
for i = 0 to ubound(arr)
  response.write arr(i) & "<br>"
next
%>
0
 
LVL 31

Expert Comment

by:alorentz
ID: 17939313
0
 
LVL 2

Expert Comment

by:_DanElliott
ID: 17939327
You can use the Split function to get the values into an array:

Dim values
values = Split(String_to_Split,"&")

Now values is an array and:
values(0) = the first part (num)
values(1) = the second part (date)
values(2) = the third part (secret)
values(3) = the fourth part (name)

0
 
LVL 31

Expert Comment

by:alorentz
ID: 17939389
>>DanElliott

When reposting, whether by mistake or not, it's good to acknowledge you provided the same answer as already suggested.  thanks
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question