We help IT Professionals succeed at work.
Get Started

i need to trim leading spaces in a number field in an access 2007 table using an update query

linbayzak asked
Last Modified: 2021-04-21
Hi Experts,

I have some data that is inconsitent, causing a list box to populate inaccurately.  The field in question is a CaseNumber field, it should be 10 digits, and it does have leading zeros which is fine.  But, some of the records have empty spaces before the leading zeros and this is not ok.  It causes some missing data, only brings in the ones that match the casenumber on the form.  So i need to update the case number in the client table and in the trips table to erase all the empty spaces before the case number.  I've tried trim in query, but didn't get the result i wanted.  Can you help.  

This is what i tried to populate the listbox  Case Number: Val(Right([CaseNumber],10))

I would rather just update these fields in the two tables than manipulate the data in the query, but i'll take either solution if it works.  Thanks in advance,

Watch Question
Top Expert 2016
This problem has been solved!
Unlock 5 Answers and 10 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE