Like Statement

J

James

Hello I have a LIKE statment in my query which looks
something like this:

LIKE [Please select a Gender (MALE/FEMALE)]

Which works It pops up a paramiter value and you type in
Male or female and it pulls out teh relevant records..

I do the same with a field called Active (this is a
checkbox with teh value's as true or false). So again I do
the same thing:

LIKE [Please select if the client is active (TRUE/FALSE)]

And it seems to do nothing does anyone have any ideas why
this would do what it does?

Many Thanks

James
 
A

Allen Browne

The Like operator is intended for partial match of text.
Your Yes/No field have have the values -1 (for true) and 0 (for false), and
cannot match the text you are typing into the box.

Change the Criteria row to something like this:
=[IsActive]
Then declare this paramater (Parameters on Query menu in query design) by
entering the name IsActive and the type as Yes/No.

If you still can't get it to work, when the Enter Parameter dialog pops up,
try entering -1 (for true), or 0 (for false).
 
D

Dale Fye

OR you could do something like the following, instead of the LIKE
clause:

= IIF([Please select if the client is active (TRUE/FALSE)] =
"True", -1, 0)

--
HTH

Dale Fye


The Like operator is intended for partial match of text.
Your Yes/No field have have the values -1 (for true) and 0 (for
false), and
cannot match the text you are typing into the box.

Change the Criteria row to something like this:
=[IsActive]
Then declare this paramater (Parameters on Query menu in query design)
by
entering the name IsActive and the type as Yes/No.

If you still can't get it to work, when the Enter Parameter dialog
pops up,
try entering -1 (for true), or 0 (for false).
 

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