Solved

Access formula to Count proceeding spaces in a field

Posted on 2013-11-14
2
424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
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…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

749 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