Truncate

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.
 
K

KARL DEWEY

I assume you want this --
1234
1234
AB12345670000WT
25541-AF00T

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

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

Top