"Like" Query

satty

Board Regular
Joined
Jan 12, 2003
Messages
68
orite' dudes,

i was wondering if it was possible to create 'like' queries. i dont actually know what they're called so im refering to them as LIKE. :wink: .

i want to create a query in which i am prompted to enter the Member name.

for example

i have members: John Smith & John Smite. however in the parameter box if i enter SMI then records for all LIKE MATCHES are shown? i know its possible ive forgotten how ta do this :(.

Thanx,


SaTTy
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
It's called just that!

The SQL you want is:

SELECT * from tablename WHERE column-name LIKE 'smit*'

If you're filling out a test box just add the * and let access do the rest

HTH

(y)
 
Upvote 0
In the query grid, below the surname field, enter this in the criteria:

Like "*" & [Enter the surname or part surname] & "*"

This will pop up a parameter prompt, allowing you to enter SMI and get your 2 names back.

If you want to use a textbox instead, change this to

Like "*" & [Forms]![MyFormName]![MyTextBoxName] & "*"

change form and textbox refs to suit.

HTH
Denis
 
Upvote 0

Forum statistics

Threads
1,221,638
Messages
6,160,994
Members
451,682
Latest member
ogoreo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top