Solved

Access formula to Count proceeding spaces in a field

Posted on 2013-11-14
2
383 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

760 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

21 Experts available now in Live!

Get 1:1 Help Now