Access 2000 Query Help

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

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))
 
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)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

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 807,865 other people just like you!

Latest posts

Staff online

Top