Wildcard/Shorten for queries (1 Viewer)

MattAnderson

Registered User.
Local time
Today, 03:43
Joined
Mar 10, 2014
Messages
11
Hi guys, what I'm trying to achieve is to have some form of wildcard inputted into my queries.

I have a database which is for a nurse to input patients etc...
One of my queries is to retrieve every patient who has been in for a headache or stomach ache etc..

Is there a way i can shorten what the user has to input.

For example instead of them typing "headache" or "stomach ache" into the prompt box they just type in "head" or "stom" etc...

Is there a way I can do this for all queries and make it a standard, instead of having to manually set the wildcards for each results there may be.

Thanks in advance.

Matt
 

pr2-eugin

Super Moderator
Local time
Today, 03:43
Joined
Nov 30, 2011
Messages
8,494
Using wildcards/using LIKE operator will affect your efficiency of your Query. However, to answer your question yes, you can use wildcard. How are you obtaining the User input, if it is a prompt box, just use.
Code:
SELECT theFields FROM theTable
WHERE theCriteriaField LIKE [enterSymptom:] & "*";
 

MattAnderson

Registered User.
Local time
Today, 03:43
Joined
Mar 10, 2014
Messages
11
Thank you ever such a lot, it works perfectly.

Regards,

Matt
 

Users who are viewing this thread

Top Bottom