A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Isolating text in a field



 
 
Thread Tools Display Modes
  #1  
Old February 27th, 2007, 03:28 PM posted to microsoft.public.access.queries
scubadiver
external usenet poster
 
Posts: 1,673
Default Isolating text in a field


Hi folks!

The following text is an example:

"F002 Internal Audit Summary Report Form Rev B.doc"

How do I isolate "Rev B" considering that everything that comes before isn't
necessarily the same length in each record.

Cheers!
  #2  
Old February 27th, 2007, 04:07 PM posted to microsoft.public.access.queries
Michel Walsh
external usenet poster
 
Posts: 2,404
Default Isolating text in a field

You can use the VBA function InStr( ), see the help file, to spot the
beginning of "Rev B" and then, use Left( ), or Mid( ), to segment the
strings in its parts:




Left( MyField & "Rev B", InStr( MyField & "Rev B" , "Rev B") - 1 )


will give what precedes the first occurrence of Rev B, in your string, or
the whole string, if Rev B is absent.



Hoping it may help,
Vanderghast, Access MVP

"scubadiver" wrote in message
...

Hi folks!

The following text is an example:

"F002 Internal Audit Summary Report Form Rev B.doc"

How do I isolate "Rev B" considering that everything that comes before
isn't
necessarily the same length in each record.

Cheers!



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:37 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.