Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Posts
    48

    Unanswered: Query not Working as Planned (Access 2007)

    I am trying to write a query that finds records in a table if StockType = "component" and part_name = "attenuator" or part_name = "oscillator" or part_name = .... (there are a few more part_names).

    I tried using the query designer to do this. The result gave me the correct part names but the StockType was both "component" and "working" (these are the only two stock types). Obviously the WHERE clause was incorrect. I tried to modify it in the SQL view, but I had no luck. If I stick to just one part_name, I get only component stock, but as soon as I add another part name I get both working and component stock records for that part_name.

    There are duplicate part names in the table, but each part has a unique part number.

    Thanks,

    Charles

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Code:
    ....
    WHERE StockType = "component" 
           AND part_name IN("attenuator", "oscillator", ....)

  3. #3
    Join Date
    Jun 2009
    Posts
    48

    Cool Query Question

    Pootle Flump,

    Thank you very much for the prompt, on-the-money reply!

    Charles

Posting Permissions

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