Changing the number of digits

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

Guest

I have a table with a few thousand records. One of the columns is a
commodity code.
For example, a few of the entries are: 00608J, 02801C, 022034
I need only the first three numbers: 006, 028, 022
Is there any way by using either a table or query that I can chop these
numbers in down to only use the first three? I have tried a few things with
an input mask but nothing has worked.
 
hursty said:
I have a table with a few thousand records. One of the columns is a
commodity code.
For example, a few of the entries are: 00608J, 02801C, 022034
I need only the first three numbers: 006, 028, 022
Is there any way by using either a table or query that I can chop these
numbers in down to only use the first three? I have tried a few things
with
an input mask but nothing has worked.

You can use a Query with a calculated field. Just type into a vacant Field
cell in the query grid:

FirstThree: Left([fieldname], 3)

This will not affect the data stored in your table, but will give you the
substring you want; it can be used for sorting, searching, or display.

John W. Vinson/MVP
 

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