Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2009
    Posts
    1

    Select query with two criteria

    Consider the table:

    Name Date Amount
    John 1/1/2009 120


    Chris 1/7/2009 45
    Mary 1/2/2009 35
    John 1/18/2009 100
    Chris 1/1/2009 20

    I need to select all records except those where name is John or Chris And date is 1/1/2009. So my query should retrieve only records 2,3 and 4. What SQL should I use?

  2. #2
    Join Date
    Jul 2008
    Location
    Alexandria, Egypt.
    Posts
    38
    Dear corni,

    Try this query:

    SELECT Table1.Name, Table1.Date, Table1.Amount, [name] & [date] AS exp1
    FROM Table1
    WHERE ((([name] & [date]) Not Like "John1/1/2009" And ([name] & [date]) Not Like "chris1/1/2009"));

    Thanks

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Query Criteria
    By Texaine in forum Queries
    Replies: 1
    Last Post: 01-24-2018, 02:36 PM
  2. very difficult (for me!) SELECT query
    By igorbaldacci in forum Queries
    Replies: 1
    Last Post: 12-02-2008, 03:30 PM
  3. Query Criteria
    By jena in forum Access
    Replies: 1
    Last Post: 08-03-2008, 04:08 AM
  4. Query Criteria
    By jena in forum Queries
    Replies: 1
    Last Post: 04-29-2008, 11:00 AM
  5. Using SELECT query within a VBA code in Access
    By championss in forum Programming
    Replies: 4
    Last Post: 10-23-2006, 05:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums