Query for "ALL"

R

Rich Palarea

I have a form that queries a database by "day".

The form values are the days of the week, but I want to add a value for "no
preference" where the results would be all values. I tried to string
together all of the days (i.e.: "Monday" AND "Tuesday" AND...) in the form
value, but the query can't evaluate it. It just returns results for the
first value.

Any idea how to do this...must be simple, right?

Thanks,
Rich
 
N

news

The form values are the days of the week, but I want to add a value for
"no
preference" where the results would be all values. I tried to string
together all of the days (i.e.: "Monday" AND "Tuesday" AND...) in the form
value, but the query can't evaluate it. It just returns results for the
first value.

You could put a predefined value in the box like "ALL" and in the script
that processes the form check to see if the posted value is "ALL" and run a
different query than if it's anything else.

Jay
http://www.tequila-stuff.com
 
R

Rich Palarea

I think my problem lies in the fact that the query is written in the page
itself and using the values submitted. Sounds like I would need to put a
routine in between that evaluates if "ALL" is the value submitted and run a
different query like SELECT * FROM Table rather than SELECT * FROM Table
WHERE Day = ::Day::

Any idea how to do this...if, in fact, this is the right way to do this?

Rich
 

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