Re: problem getting a query to recognize "Not" and "<>" in a value list combo box

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Sun, 5 Jul 2009 00:22:56 -0700, "Paul" <begone@xxxxxxxx> wrote:

I didn't realize you could designate a form control in a query field and
then apply criteria to it. I can see where once you grasp that concept, the
other logic you suggested in the WHERE clause will produce the desired
records. But setting a query field to the value of a form control - it
would never have occurred to me to do that. When I think of queries, I
always think in terms of building it from fields in tables and other
queries, and sometimes even adding an expression that might not consist of
fields. But putting a form control in there, somehow seems
counterintuitive. I can see that it works, but I guess I need to mull it
over for a while before I can really grasp it conceptually.

I remember having just the same astonished reaction when I first learned this
trick. It's cool.

The WHERE clause is just a Boolean algebra expression which evaluates to
either TRUE or FALSE. If it's TRUE... the record is retrieved. If it's
FALSE... it's not. Of course normally the truth or falsity of the expression
depends on the value of a field or fields in the record; but, as in this case,
there are times when you make the decision on some other basis.

I've even had occasion to use queries with

WHERE 1 = 1

or

WHERE 1 = 0

if I want to explicitly retrieve all (or no) records.
--

John W. Vinson [MVP]
.



Relevant Pages

  • Re: JOIN on multiple conditions
    ... You must use the OUTER JOIN syntax, of course, ... >but if you learn only the INNER JOIN syntax does it change the way you ... More complicated queries should not be written by ... condition is placed in the ON or in the WHERE clause. ...
    (microsoft.public.sqlserver.programming)
  • Re: error -2147217904 - how to fix :o( ?
    ... If the saved queries don't have WHERE clauses, yes, the saved ... When I say on-the-fly SQL, ... use the base saved query and add a WHERE clause. ...
    (comp.databases.ms-access)
  • Re: how to use partitions once created?
    ... Your example queries worked perfectly. ... is a Where clause and a slice the same thing - semantically ... > Please do not send email directly to this alias. ...
    (microsoft.public.sqlserver.olap)
  • Re: where clause
    ... embedded in queries, I suspect that depends on the nature of the queries, ... A concept that may help to understand is  to note that Jet evaluates the ... Move the VBA function to the WHERE clause, and now, ... use another query as source if previous query to limit recrods. ...
    (microsoft.public.access.queries)
  • Re: OT: where to get mySQL questions answered?
    ... >queries for a search engine, I'm experiencing more crippling problems as ... >soon as I add an OR to my WHERE x LIKE '%blah%' type queries. ... >If more than one word is typed in, it adds to the WHERE clause. ...
    (comp.lang.php)