Solved

Select to right of &

Posted on 2006-11-14
4
627 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 500 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
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/…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

726 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