Solved

Access formula to Count proceeding spaces in a field

Posted on 2013-11-14
2
391 Views
Last Modified: 2013-11-14
I have a table that contains text values with proceeding spaces. I want to add another column in my query that provides the count of the proceeding spaces. There is also spaces of the back side of the text that I do not want to count.

In excel I use the flowing formula, but I can not figure out how to translate in access.

 =FIND(LEFT(TRIM(A1)),A1)-1

Thanks!
0
Comment
Question by:Alphacircuits
2 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 200 total points
ID: 39647899
Try this:

for left spaces:

= Len("" & A1) - Len(Ltrim("" & A1))

For right spaces:

= Len("" & A1) - Len(Rtrim("" & A1))



For All spaces:

= Len("" & A1) - Len(trim("" & A1))
0
 

Author Closing Comment

by:Alphacircuits
ID: 39647920
Thank you very much!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now