1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Access 2000 Query Help

Discussion in 'Business Applications' started by pulp_, Jan 13, 2003.

Thread Status:
Not open for further replies.
  1. pulp_

    pulp_ Thread Starter

    Joined:
    Jan 13, 2003
    Messages:
    5
    I have a problem with a Query. I have fields with Yes/No type and I want to be able to enter a State field and have the records with No in any of the fields come up. The part that doesn't seem to work is when I enter the State, everything still comes up with all the States. Below is the SQL expression that is giving me trouble. Any help would be great. :) Thanks.

    WHERE (((AgentData.State)=[Enter Desired State]) AND ((AgentData.Email)=No)) OR (((AgentData.BusinessCertificate)=No)) OR (((AgentData.[Lease/UtilityBill])=No)) OR (((AgentData.FedTaxIdNo)=No)) OR (((AgentData.Page19)=No)) OR (((AgentData.CopyOwnerID)=No)) OR (((AgentData.NewAgreement)=No)) OR (((AgentData.Ofac)=No))
     
  2. downwitchyobadself

    downwitchyobadself

    Joined:
    Oct 13, 2000
    Messages:
    941
    Hi, welcome to TSG. The SQL is tough to read because it's got all those Access-furnished parentheses in it, and so it's impossible to read.

    Try pasting this version in in place of it; this is the correct SQL version of what you're trying to do, or at least as I understand it: show me all records where either the state = a user-entered value or at least one of these Yes/No fields is No.

    WHERE (AgentData.State=[Enter Desired State]) AND (AgentData.Email=No OR AgentData.BusinessCertificate=No OR AgentData.[Lease/UtilityBill]=No OR AgentData.FedTaxIdNo=No OR AgentData.Page19=No OR AgentData.CopyOwnerID=No OR AgentData.NewAgreement=No OR AgentData.Ofac=No)
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/113060

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice