need to build a query that combines wildcards

  • Thread starter Thread starter Guy Story
  • Start date Start date
G

Guy Story

Currently I have a database setup that bases information based on types
of cancer. I have a single location in the database that has type(s) of
cancers a patient may have. Originally I built up a query for each
type. I now have a request that users get a dialog box so they can
enter the type and get a report. The types of cancer in the type field
are in no certain order. The query: LIKE "*colon*" works like a charm.
If colon is anywhere in that record it gets found. If I use [Enter
Cancer Type] and the result is different in count than the discrete
query, for example 5 instead of 7. I tried to combine the two: Like
"*[Enter Type]*" but got the same result as [Enter Cancer Type], the
count was wrong. Like [Enter Cancer Type] & "*" does not yield the
correct count either. Any suggestions?

Thanks,

Guy
 
Not more than 5 minutes after I sent my post I found my answer. The
query that works for me is:

Like "*" & [Enter Cancer type] & "*"

I am getting the same numbers for it as I do for

Like "*colon*"

I posted my result encase someone else is looking later.

Guy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top