evaluate Yes/No field

S

shank

I have a query that works fine until I add the following...

.... AND PR.ATU='Yes' ORDER BY....

I've tried....
.... AND PR.ATU='True' ORDER BY....
.... AND PR.ATU <> 'No' ORDER BY....
.... AND PR.ATU=1 ORDER BY....

PR.ATU is a Yes/No field.
I get a Data Mismatch error.
Remove the above and the query runs fine.
How do you evaluate a Yes/No field?

thanks!
 
T

tina

a Yes/No field is a Boolean data type, the values are True/False (no single
or double quotes, which are used for Text values, not Boolean), or the
numeric equivalent which is -1/0.
I've tried....
... AND PR.ATU='True'

try
.... AND PR.ATU = True

notice there are no quotes.

hth
 

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