1. You are viewing our forum as a guest. For full access please Register. WindowsBBS.com is completely free, paid for by advertisers and donations.

MS Access - Query with criterion

Discussion in 'Other PC Software' started by tenbob, 2003/08/09.

Thread Status:
Not open for further replies.
  1. 2003/08/09
    tenbob

    tenbob Inactive Thread Starter

    Joined:
    2002/08/03
    Messages:
    796
    Likes Received:
    0
    I have a database with a text field that determines a future action. In some of the records that text field says "DELETE ". I don't want to delete the record YET, but I want to make a query that leaves out all records that have DELETE in that field

    I have tried = NULL <> "delete" <> "DELETE "

    What is the correct statement?
     
  2. 2003/08/10
    merlin

    merlin Inactive

    Joined:
    2003/01/07
    Messages:
    1,111
    Likes Received:
    0
    NULL <> "delete" AND NULL <> "DELETE
    Not sure !
    Regards
     

  3. to hide this advert.

  4. 2003/08/10
    tenbob

    tenbob Inactive Thread Starter

    Joined:
    2002/08/03
    Messages:
    796
    Likes Received:
    0
    I found out why you were not sure. Not workable :)
     
  5. 2003/08/11
    merlin

    merlin Inactive

    Joined:
    2003/01/07
    Messages:
    1,111
    Likes Received:
    0
    Posting all the query text may be a good idea ...
    regards
     
  6. 2003/08/11
    tenbob

    tenbob Inactive Thread Starter

    Joined:
    2002/08/03
    Messages:
    796
    Likes Received:
    0
    It's the last criterion that is the one in question
    =====================================

    SELECT [SouthNassauSHHH to 3/2/03].PaidThru, [SouthNassauSHHH to 3/2/03].[Last Name], [SouthNassauSHHH to 3/2/03].[First Name], [SouthNassauSHHH to 3/2/03].Business, [SouthNassauSHHH to 3/2/03].Address, [SouthNassauSHHH to 3/2/03].Town, [SouthNassauSHHH to 3/2/03].St, [SouthNassauSHHH to 3/2/03].Zip, [SouthNassauSHHH to 3/2/03].[Member Description], [SouthNassauSHHH to 3/2/03].[Newsletter Status]
    FROM [SouthNassauSHHH to 3/2/03]
    WHERE ((([SouthNassauSHHH to 3/2/03].[Newsletter Status])<> "delete" And ([SouthNassauSHHH to 3/2/03].[Newsletter Status])<> "DELETE "))
     
  7. 2003/08/11
    tenbob

    tenbob Inactive Thread Starter

    Joined:
    2002/08/03
    Messages:
    796
    Likes Received:
    0
    My problem seems to be constructing a query when one field is partly NULL. The field I mentioned has mostly no entries but some have "R ". I want to create the ones without an "R ".

    Since the field is a text field, is that what is causing the trouble. Do have to say > "R" to get " ".
     
  8. 2003/08/12
    merlin

    merlin Inactive

    Joined:
    2003/01/07
    Messages:
    1,111
    Likes Received:
    0
    Why are you testing the fields contents as "delete" or "DELETE "
    if it can only contain blanks or "R "
    Do not follow ...
    regards
     
  9. 2003/08/12
    tenbob

    tenbob Inactive Thread Starter

    Joined:
    2002/08/03
    Messages:
    796
    Likes Received:
    0
    I'm not. It is this field that I am testing below that is tested for delete . It can be null or Delete

    Newsletter Status])<> "delete

    The problem field is tne temp field that could be "R' I want to view all the records without the "R "
     
  10. 2003/08/12
    merlin

    merlin Inactive

    Joined:
    2003/01/07
    Messages:
    1,111
    Likes Received:
    0
    Do not understand what field you are referring to :
    "the temp field" ??
    regards
     
  11. 2003/08/12
    tenbob

    tenbob Inactive Thread Starter

    Joined:
    2002/08/03
    Messages:
    796
    Likes Received:
    0
    SELECT [SouthNassauSHHH to 3/2/03].JoinDate, [SouthNassauSHHH to 3/2/03].PaidThru, [SouthNassauSHHH to 3/2/03].[First Name], [SouthNassauSHHH to 3/2/03].[Last Name], [SouthNassauSHHH to 3/2/03].[Member Description], [SouthNassauSHHH to 3/2/03].Business, [SouthNassauSHHH to 3/2/03].TempMarking
    FROM [SouthNassauSHHH to 3/2/03]
    WHERE ((([SouthNassauSHHH to 3/2/03].[Member Description])= "X" Or ([SouthNassauSHHH to 3/2/03].[Member Description])= "C ") AND (([SouthNassauSHHH to 3/2/03].TempMarking)<> "R "));


    The last field, as it is, yields ONE blank record and I want to show all records that do not have an "R" there. Those fields right now are blank (or all spaces, dont know which) It is a text field of length 10.
     
  12. 2003/08/13
    maxmangion

    maxmangion Inactive

    Joined:
    2002/08/13
    Messages:
    252
    Likes Received:
    0
    i would recommend you visiting this forum , it is dedicated to MS Access only and there are plenty of members their, that are more into the field.

    Hope you solve your problem !
     
  13. 2003/08/13
    merlin

    merlin Inactive

    Joined:
    2003/01/07
    Messages:
    1,111
    Likes Received:
    0
    I agree with Max - especially as the query seems to vary in content quite often.
    I cannot help further, sorry.
    regards
     
Thread Status:
Not open for further replies.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.