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
Solved

Identifyng one word or two in a field

Posted on 2011-09-12
4
305 Views
Last Modified: 2012-05-12
I have a field which somtimes includes two words and I only need the first word.  I can use this to show only the first word:
Group1: Left$([Group],InStr(1,[Group]," ")-1)
But when I use it I get #ERROR for all of the fields that only have one word.  How do identify the field has one or two words so I can skip if it only has one word?

Thanks.
0
Comment
Question by:ScootterP
  • 2
  • 2
4 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 36524940

try this

Group1: Left$([Group] & " ",InStr(1,[Group]," ")-1)
0
 

Author Comment

by:ScootterP
ID: 36524991
Still getting #ERROR for the fields that have one word.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 36525000


Group1: Left$([Group] & " ",InStr(1,[Group] & " "," ")-1)
0
 

Author Closing Comment

by:ScootterP
ID: 36525024
That did it.  I was about to say that I am importing from an Excel spreadsheet so the space might have some sort of funny format.

Thanks.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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 …

808 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