Solved

Need help separating data in a string

Posted on 2013-06-26
5
205 Views
Last Modified: 2013-06-28
I have thousands of records in a single field within a table in the following format

\\SERVERNAME\C$\DOCUMENTS AND SETTINGS\USERNAME

The actual data has different values for SERVERNAME AND USERNAME then shown above. I would like to extract the SERVERNAME  and USERNAME values into their own fields.

How to do?
0
Comment
Question by:snyperj
[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
  • 2
  • 2
5 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 39278543
Dim arr
dim Myservername as string
dim MyUsername as string
arr= split(mid(yourfieldnamehere,3), "/")

MyServername = arr(0)
MyUsername = arr(3)
0
 

Author Comment

by:snyperj
ID: 39278585
Sorry should have been more specific on what I was looking for.  I created a 'server' and a 'username' field in the table... so I was just looking for how to populate this with an update query run against the table.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 39278634
Depends on which version of Access you have.

For the latest couple of versions ...

Update tablename set [server] =  split(mid(yourfieldnamehere,3), "/")(0),
[username] =split(mid(yourfieldnamehere,3), "/")(3)
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 250 total points
ID: 39278827
try this update query, change tablex and [fieldName] accordingly

update tablex
set server=Mid([fieldName], 3, InStr(3, [fieldName], "\") - 3)
, username=Mid([fieldName], InStrRev([fieldName], "\") + 1)
0
 

Author Closing Comment

by:snyperj
ID: 39285364
didn't need to do it afterall, but thanks.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

739 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