Results 1 to 3 of 3

Thread: Access Query Help

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Access Query Help

    Hello everyone! First time poster here. I have a quick question about how to search for multiple criteria in the same column. The data in this column is not separated and represents every election a voter has voted in. For example one row of data in this column contains GE12GE11PE10GE09GE08GE06PE06GE04GE02GE00GE98GE97 while the one below it could just have PE10. I am looking to make a form with drop down boxes that allows a user to run a query to look for multiple specific elections while excluding others. For instance, I would like to search for all voters who voted in GE12 and GE11 but not those who voted in PE10 and GE02. What query or queries would i use to accomplish this? If I didn't clarify well enough please let me know. I cannot post the database for security reasons.

  2. #2
    Member Transformer's Avatar
    Join Date
    Mar 2012
    Posts
    91
    Rep Power
    13
    Code:
    SELECT [Voters] 
      FROM 
           [Table] 
    WHERE inStr(1,[Election],"GE12") > 0  AND  inStr(1,[Election],"GE11") > 0
    Here Election is your column name in which you have entries like "GE12GE11PE10GE09GE08GE06PE06GE04GE02GE00GE98G E97"

    To exclude, you can just change or add conditions in the above given query.
    e.g. instr(1,[Election],"PE10 ") = 0
    Last edited by Transformer; 05-08-2013 at 12:09 PM.
    Regards,

    Transformer

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    Awesome!! Thanks a lot it worked perfectly!

Similar Threads

  1. Ranking In MS Access
    By Transformer in forum MS-Access Tips And Tricks
    Replies: 1
    Last Post: 09-15-2023, 07:12 AM
  2. Syntax Error In SQL Update Query Statement
    By ashu1990 in forum Access Help
    Replies: 3
    Last Post: 06-11-2013, 11:48 AM
  3. Full Outer Join in MS Access
    By Transformer in forum Tips, Tricks & Downloads (No Questions)
    Replies: 0
    Last Post: 05-18-2013, 08:42 PM
  4. Dynamic Chart Query
    By leopaulc in forum Excel Help
    Replies: 6
    Last Post: 11-26-2012, 04:50 PM
  5. help with after insert event in Access 10
    By richlyn in forum Access Help
    Replies: 9
    Last Post: 03-03-2012, 10:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •