Solved

Identifyng one word or two in a field

Posted on 2011-09-12
4
290 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 119

Expert Comment

by:Rey Obrero
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 119

Accepted Solution

by:
Rey Obrero 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

911 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

18 Experts available now in Live!

Get 1:1 Help Now