Isolating on a string of characters

  • Thread starter Thread starter Ted Allen
  • Start date Start date
T

Ted Allen

Hi Haji,

This should be easy if there aren't any other colons in
the field. In that case, you could use the Instr()
function to return the position of the colon. Use that
within the Mid() function to return the value that you
want (you would subtract two from the Instr() function
result as the starting point argument in the Mid()
function, and the length would be 2)

If your field does have other colons, post samples of the
data, as well as any rules that are constant (such as
there are always three colons, or any other constants to
the data pattern) and I or someone else can help further.

HTH, Ted Allen
 
Ted,

Thanks for your help. Isn't there an LTRIM function that
will strip the left most characters from a string? I was
testing it out but cannot figure out how it works. LTRIM
(ItemNumber),2 or something like that?

Thanks,

Haji
 
You can get just the first two characters in the string using the LEFT function.
In a select query,

Field: JustLeftTwo: Left(ItemNumber,2)

The Trim functions (LTrim, RTrim, and Trim) remove leading and trailing SPACES only.
 
Back
Top