?
Solved

Identifyng one word or two in a field

Posted on 2011-09-12
4
Medium Priority
?
323 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:Scott Palmer
[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
  • 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:Scott Palmer
ID: 36524991
Still getting #ERROR for the fields that have one word.
0
 
LVL 120

Accepted Solution

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


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

Author Closing Comment

by:Scott Palmer
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
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 …
Suggested Courses

777 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