Criteria in query's

  • Thread starter Thread starter Henro
  • Start date Start date
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
 
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?] & """"
 
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
 
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


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

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

jim
 
Back
Top