Solved

Check if all characters are spaces- Access 2003

Posted on 2013-01-29
5
320 Views
Last Modified: 2013-02-04
I have a program that brings in data from another system.  However, if ther eis nothing in the field, rather than brining in null, it seems to populate with a lot of spaces - how can I check to see if all characters in a field a simply spaces and set the field to null?

Sandra
0
Comment
Question by:ssmith94015
[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
5 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 38833356
try this query

select [fieldName], len([fieldName])
from tableName
where len([fieldName]) >0

check the resulting query..

maybe they are not spaces, but some unprintable characters like tab, CR, LF

to set the fields to Null, use an update query, but you need to find out first what those unprintable characters
0
 
LVL 26

Expert Comment

by:jerryb30
ID: 38833406
Try trim(fieldName)
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 500 total points
ID: 38834391
Use this expression:

IIf(Len(Trim([YourPerhapsEmptyField])) = 0, Null, Trim([YourPerhapsEmptyField]))

/gustav
0
 

Author Closing Comment

by:ssmith94015
ID: 38851766
This worked as I really did need to check to see if it was 0 length as some were and some had spaces in both front and at the end of the imported string.

Sandra
0
 
LVL 51

Expert Comment

by:Gustav Brock
ID: 38852126
Great!

/gustav
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

622 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