Split field?

J

Jennifer

I have a field for truck codes:

MAD1
PRY3
FLL0
PR56
US23

I need to pull the LAST number and put in a new field. The last number is
ALWAYS a number but somethimes there are other numbers in the field. They are
ALL 4 places.

Is there a formula I can use?

Thanks!
 
J

Jerry Whittle

This will get the last character of the field in a query if you put in the
correct field name between the [ ].

TheNumber: Right([Truck Code Field],1)

You could use Right([Truck Code Field],1) as the update to in an update
query for the field where you want to store the number.
 
J

Jennifer

THANK YOU!

Jerry Whittle said:
This will get the last character of the field in a query if you put in the
correct field name between the [ ].

TheNumber: Right([Truck Code Field],1)

You could use Right([Truck Code Field],1) as the update to in an update
query for the field where you want to store the number.


--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


Jennifer said:
I have a field for truck codes:

MAD1
PRY3
FLL0
PR56
US23

I need to pull the LAST number and put in a new field. The last number is
ALWAYS a number but somethimes there are other numbers in the field. They are
ALL 4 places.

Is there a formula I can use?

Thanks!
 
M

Marshall Barton

Jennifer said:
I have a field for truck codes:

MAD1
PRY3
FLL0
PR56
US23

I need to pull the LAST number and put in a new field. The last number is
ALWAYS a number but somethimes there are other numbers in the field. They are
ALL 4 places.


You can get the last digit by using Right(thefield, 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