Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Select query (Access 2000)

    I tried to build a select query showing only products with a grossprice > 0 however the results show all the products, also products where grosssprice is 0. In my example these are the products 9 and 10. Can you help me solve the problem ?


    SELECT QryProductsAndprices.grade
    FROM QryProductsAndprices WHERE "GrossPrice > 0 Or GrossPrice Is Not Nulll"
    Attached Files Attached Files

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Select query (Access 2000)

    Remove the quotes from around the WHERE clause! It should just be:

    SELECT QryProductsAndprices.grade
    FROM QryProductsAndprices WHERE GrossPrice > 0 Or GrossPrice Is Not Null

    Also, you misspelled Null.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select query (Access 2000)

    Mark Liquorman has already posted the solution, but I'd like to add a general recommendation (again): for best results, you should create a query interactively in design view, and test and edit it until it works the way you want. Only then switch to SQL view to see the resulting SQL string.

  4. #4
    4 Star Lounger
    Join Date
    Feb 2002
    Posts
    537
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Select query (Access 2000)

    Thank you very much for your replies.I think i didnt explaint well what i want. My intention was to exclude form the query those products in which grossprice is 0 or Null.These products in my example are products 9 and 10. However, in spite of the correction of the query, when i click the button OrderBy, the products 9 and 10 are still shown.How could i eliminate them with the query ?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Select query (Access 2000)

    Try

    SELECT grade
    FROM QryProductsAndprices
    WHERE GrossPrice > 0

    Once again, you should create and test your query in design view - it's easy to try out conditions until the query does what you want.

Posting Permissions

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