SQL statement in the table

I

inungh

I have my option in the table just for easier configuration, but I get
too complex SQL message for a number field with 1 or 0 criteria.

MyStatus field in MyTable which is a number field.

My SQL is

Select * from MyTable where MyStatus = (select MyOption where
MyOptionID = 1)

It works if MyOption is "1", but I got too complex SQL statement when
MyOption is "1 or 0"

Are there any work around to store more than one option in the table
for multi criteria?


Your help is great appreciated,
 
K

KARL DEWEY

Your terminology is confusing to me.
You can not have SQL in a table.
MyStatus is a field in your table named MyTable. What kind of object is
MyOption?

What are you trying to do with this query --
Select * from MyTable where MyStatus = (select MyOption where MyOptionID = 1)
 
C

CafeenMan

I think you have to write it like

WHERE (MyOption=1) OR (MyOption=0)

The parentheses aren't strictly necessary but they make it easier to read
and debug.

I don't think you can do what you're attempting (multiple conditions with
the field referenced just once)

MyOption = 1, or 2 or 178.0, etc.
 
I

inungh

I think you have to write it like

WHERE (MyOption=1) OR (MyOption=0)

The parentheses aren't strictly necessary but they make it easier to read
and debug.

I don't think you can do what you're attempting (multiple conditions with
the field referenced just once)

MyOption = 1, or 2 or 178.0, etc.











- Show quoted text -

Thanks millions for helping,
 

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