Truncate

  • Thread starter Thread starter RRM
  • Start date Start date
R

RRM

I am using Access pulling information from Macola Progression where the Part
Number field is 15 characters. It is a text field. Some fields have 4 some
have the entire 15. Does anyone know how to write a query that will pull only
the left most characters that are not null? To complicate this a little more,
there are blank characters in some of the part numbers. Examples are:
Part Number 1234
Part Number 1234 ABC
Part Number AB12345670000WT
Part Number 25541-AF00T

Any help would be appreciated.
 
I assume you want this --
1234
1234
AB12345670000WT
25541-AF00T

Left([YourField], IIF(InStr([YourField], " ") = 0, 15, InStr([YourField], "
")-1))
 
Back
Top