Displaying partial value in query results

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

Guest

Hi, I have a pretty simple query. One of the fields being brought into the
query is a series of characters such as this:

ABC-ABC-ABC-ABCD-1244-ABC

In the query results I ONLY want to display the '1244', but not the rest of
the characters. Is there a simple and fast function or expression that can
be used to isolate the value I want without having to write a number of
consecutive queries or expressions?

Thanks!
 
Depends on a bunch of things, a couple come to mind.

If this is a field that is a concantenation of several other fields, you
might have access to the piece you need, but just haven't included it in the
select list.

If this result field ALWAYS has the same format, you could use the Mid
function to isolate the part you need.

If the part you want is ALWAYS the numeric part, but it occurs at differing
places within the string, you can write a VBA function that can return just
the numeric part, using several string manipulation functions and testing for
the values of each ascii character...

So basically the answer is no, there is no magic bullet, but there may be a
few bullets that if used judiciously can get youwhere you need to be.
 
Thanks very much for your help! The 'mid' function worked great!

(Unfortunately the data was not concatenated in such a way that I could
obtain only part of it.)

AC
 

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