Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inactivating A Record

Status
Not open for further replies.

czarjosh

Technical User
Jul 14, 2002
79
US
I have built a registration database, and on one of the forms there are two checks bocks labeled Canceled Before Deadline and Canceled After Deadline. So if these check boxes are checked I do not want these records appearing on reports.

However the queries I am writing for the reports do not seem to work.

Here is the SQL for one of them:

SELECT [First Name] & " " & [Last Name] AS Name, Registration.[First Name], Registration.[Last Name], Registration.Facility, Registration.Delegate, Registration.Worker, Registration.[Chapter Officer], Registration.[Executive Board], Registration.ECA, Registration.[Cancellation/NoShow]
FROM Registration
WHERE (((Registration.Delegate)=Yes) AND ((Registration.[Cancellation/NoShow])=No)) OR (((Registration.Worker)=Yes) AND ((Registration.[Cancellation/NoShow])=No)) OR (((Registration.[Chapter Officer]) Is Not Null) AND ((Registration.[Cancellation/NoShow])=No)) OR (((Registration.[Executive Board])=Yes) AND ((Registration.[Cancellation/NoShow])=No)) OR (((Registration.ECA)=Yes) AND ((Registration.[Cancellation/NoShow])=No));


IS there a better way to be inactivating a record?
 
The WHERE part of the SQL statement works in a similar manner as a mathematical statement. In other words, where in math (4+2)/2=3 isn't the same as 4+2/2=5, the SQL statement (A OR B) AND C isn't the same as A OR (B AND C).

Double check your () in the WHERE statement and make sure it is asking for exactly what you want. The query will always give you what you ask for, it's just a matter of making sure you are asking the right questions.

Hope this helps,


TwoOdd
--------------
Good judgment comes from experience, and experience comes from bad judgment.
-- Barry LePatner
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top