Results 1 to 2 of 2

Thread: Query: exclude

  1. #1
    Join Date
    Nov 2006
    Posts
    1

    Unanswered: Query: exclude

    Hi, I am trying to write what seems like a fairly simple query in Access but not finding it in any help in the "help" file.

    For any record where the STATUS field = "canceled" I want the query to exclude that record, and all such records with that CUST.NUMBER.

    This is probably a newbie question...thanks!

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    select foo
         , bar
      from daTable
     where status <> 'canceled'
       and custnumber not in
           ( select custnumber
               from daTable
              where status = 'canceled' )
    Last edited by r937; 11-09-06 at 12:39.
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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