Chat with a LIVE Microsoft Access Expert!
 
       
 

         

   

Go Back   Access World Forums > Microsoft Access Discussion > Queries

 
 
Chat with a LIVE Microsoft Access Expert!
Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-02-2006, 01:48 PM
eggplantq
Guest
 
Posts: n/a
Anti-querying?

OK,
I work for a political party. I work with voter history information. Normally, I am doing queries in order to bring up particular voters, and eliminate others.

Example - the basic table I work with contains the names, addresses, affilitations, and voting histories of everyone in my county. I normally query to bring up voters of a particular party, or people who voted in a particular election or number of elections or both. I more or less sort voters out, but in a positive manner, by creating tables with voters who did a particular thing.

For example: out of all the voters, I just want Democrats who voted in two of the past three primaries. I would then get a table that contained just those voters and no others.

Today, though, I was asked to create a table that would exclude voters based on their behavior, exluding voters who did a particular thing but showing everyone else.

Example, I have a request for all of the voters in the county, except those who voted in the 2004 and 2002 primaries. I know how to create a table with those voters and no others, but I don't know how to query for everyone but those voters. Can anyone help?
Reply With Quote
Sponsored Links
  #2  
Old 06-02-2006, 02:20 PM
RV RV is offline
Registered User
 
Join Date: Feb 2002
Location: UK
Posts: 1,115
RV is on a distinguished road
I know how to create a table with those voters and no others

I do hope I misunderstand you in such that you're not creating separate tables per requested query

You basically should have 2 tables, one with voters info, one with votes.
Tables should have a one to many relation.
Now if you register when primaries were held, you can create a rather simple query, excluding the 2002 and 2004:

WHERE Year(primariesdate) NOT IN (2002, 2004)

That's assuming that you store the primaries date.

RV
Reply With Quote
  #3  
Old 06-02-2006, 02:23 PM
pbaldy's Avatar
pbaldy pbaldy is offline
Who is John Galt?
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 12,988
pbaldy is a glorious beacon of lightpbaldy is a glorious beacon of lightpbaldy is a glorious beacon of lightpbaldy is a glorious beacon of lightpbaldy is a glorious beacon of light
One way would be to create a query that returns those people that did vote in those elections, then use the unmatched query wizard to compare that query to your main table to find those that did not.
__________________
Paul
Microsoft Access MVP
www.BaldyWeb.com
Reply With Quote
Sponsored Links
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AVG anti Virus and Lost Records geraldcor General 8 08-22-2010 05:00 AM
Querying for an astricks RevDocJeff Queries 1 10-11-2005 12:44 PM
Querying a SubForm with a MANY to MANY relationship with MainForm mbrost Forms 3 07-06-2005 06:25 AM
Need help querying into text field tonidavid5 Modules & VBA 4 11-05-2004 03:36 PM
querying across different fields linked 1-to-1 mincher Queries 5 07-07-2004 08:26 AM


All times are GMT -8. The time now is 09:57 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) copyright 2009 Access World