Exclude Data from Query

Hi
I would like to create a query which will exclude data that has an "-" after the first word in a description field
ie:-
BEARING-BALL
OEM-
PUMP-

Gordon
Gordon HughesDirectorAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
So this would be acceptable:

BEARING BALL-

?

/gustav
0
Gordon HughesDirectorAuthor Commented:
Hi

Not quite, I want to exclue the data record where the description starts with a word proceeded with the "-"

Hope this makes sense

Gordon
0
Gustav BrockCIOCommented:
Then you could use:

.. Where InStr([Description], "-") <= InStr([Description], " ")

/gustav
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

Gordon HughesDirectorAuthor Commented:
Hi
Trying you suggestion it comes up with invalid syntex
Gordon
0
Gustav BrockCIOCommented:
Of course. That what just the criteria part.
Don't know your query. A minimum would be:

Select * From tblYourTable Where InStr([Description], "-") <= InStr([Description], " ")

Replace with your actual table and field name.

/gustav
0
Gordon HughesDirectorAuthor Commented:
Hi

I put this as a SQL statement Ok

But it is not excluding where the first work is proceeded with the -
ie OEM-

Gordon
0
Gustav BrockCIOCommented:
Ah, I see, it's slightly more complicated. Try with this criteria:

.. Where IIf(InStr([Description], " ") = 0, InStr([Description], "-") = 0, IIf(InStr([Description], "-") = 0, True, InStr([Description], "-") >= InStr([Description], " ")))

/gustav
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gordon HughesDirectorAuthor Commented:
Hi

It works
Thanks
Gordon
0
Gordon HughesDirectorAuthor Commented:
Thanks
0
Gustav BrockCIOCommented:
You are welcome!

/gustav
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.