Criteria in query's

H

Henro

I have several query's with very simple criteria.

E.g. in the query 'Engineers' you will find the criterium [Which One?]

This works fine if you want a certain name. But is there something I can
fill in to get them all?
Or do I need te define a new query without criteria?

Grtz Henro
 
D

Danny J. Lesandrini

If you use the LIKE operator, then users can supply the * to get them all.

LIKE [Which One?]

becomes Like *

Now, I forget if you need to supply quotes, but if so, do this ...

(single quotes)
LIKE "'" & [Which One?] & "'"
(or double quotes)
LIKE """" & [Which One?] & """"
 
H

Henro

Thank you!

Danny J. Lesandrini said:
If you use the LIKE operator, then users can supply the * to get them all.

LIKE [Which One?]

becomes Like *

Now, I forget if you need to supply quotes, but if so, do this ...

(single quotes)
LIKE "'" & [Which One?] & "'"
(or double quotes)
LIKE """" & [Which One?] & """"
--

Danny J. Lesandrini
(e-mail address removed)
http://amazecreations.com/datafast


Henro said:
I have several query's with very simple criteria.

E.g. in the query 'Engineers' you will find the criterium [Which One?]

This works fine if you want a certain name. But is there something I can
fill in to get them all?
Or do I need te define a new query without criteria?

Grtz Henro
 
T

Tom Wickerath

Like [Which One?] & "*" or
Like "*" & [Which One?] & "*"

If the user does not enter anything, they should get all records returned. The second
version will return records where the entered parameter is found anywhere within the
field. The first one returns records where the entered parameter is at the start of the
field.

Tom
_____________________________________

If you use the LIKE operator, then users can supply the * to get them all.

LIKE [Which One?]

becomes Like *

Now, I forget if you need to supply quotes, but if so, do this ...

(single quotes)
LIKE "'" & [Which One?] & "'"
(or double quotes)
LIKE """" & [Which One?] & """"
--

Danny J. Lesandrini
(e-mail address removed)
http://amazecreations.com/datafast


_____________________________________
 
J

Jim Harrison

Something along the line of like[Which One?]&"*"

I think then hitting enter with a blank entry gives you everything?

jim
 

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

Top