Parse field in query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a table called MasterData with a field called Originator.
The field data looks like this...

Lou Santana
Steven Sentry/Miami/PU/WC/US
CN=Kathy T. Buon/OU=Miami/OU=BU/O=WC/C=US
Terry J Leif

I need it to look like this...
Lou Santana
Steven Sentry
Kathy T. Buon
Terry J Leif

How can this be parsed??
 
What a mess that you're stuck with! Below will look for the first / and
return the string before it in a query. If there isn't a / it returns the
entire string. Of course this doesn't help with the CN= in CN=Kathy T. Buon.

Parsed: IIf(InStr([Originator],"/")>0, Left([Originator],
InStr([Originator],"/")-1),[Originator])

Watch out for word-wrapping.

It's a start.
 
Thanks, but I need the CN= parsed out of the string too.

Doesn't do much good if I cant get just the name itself.

Thanks very much for your code.


--
deb


Jerry Whittle said:
What a mess that you're stuck with! Below will look for the first / and
return the string before it in a query. If there isn't a / it returns the
entire string. Of course this doesn't help with the CN= in CN=Kathy T. Buon.

Parsed: IIf(InStr([Originator],"/")>0, Left([Originator],
InStr([Originator],"/")-1),[Originator])

Watch out for word-wrapping.

It's a start.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

deb said:
I have a table called MasterData with a field called Originator.
The field data looks like this...

Lou Santana
Steven Sentry/Miami/PU/WC/US
CN=Kathy T. Buon/OU=Miami/OU=BU/O=WC/C=US
Terry J Leif

I need it to look like this...
Lou Santana
Steven Sentry
Kathy T. Buon
Terry J Leif

How can this be parsed??
 
If there is alway an equal sign then use this --
Parsed: IIf(InStr([Originator],"=")>0, Mid(IIf(InStr([Originator],"/")>0,
Left([Originator],
InStr([Originator],"/")-1),[Originator]),InStr([Originator],"=")+1),
IIf(InStr([Originator],"/")>0, Left([Originator],
InStr([Originator],"/")-1),[Originator]))

--
KARL DEWEY
Build a little - Test a little


deb said:
Thanks, but I need the CN= parsed out of the string too.

Doesn't do much good if I cant get just the name itself.

Thanks very much for your code.


--
deb


Jerry Whittle said:
What a mess that you're stuck with! Below will look for the first / and
return the string before it in a query. If there isn't a / it returns the
entire string. Of course this doesn't help with the CN= in CN=Kathy T. Buon.

Parsed: IIf(InStr([Originator],"/")>0, Left([Originator],
InStr([Originator],"/")-1),[Originator])

Watch out for word-wrapping.

It's a start.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

deb said:
I have a table called MasterData with a field called Originator.
The field data looks like this...

Lou Santana
Steven Sentry/Miami/PU/WC/US
CN=Kathy T. Buon/OU=Miami/OU=BU/O=WC/C=US
Terry J Leif

I need it to look like this...
Lou Santana
Steven Sentry
Kathy T. Buon
Terry J Leif

How can this be parsed??
 

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

Back
Top