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

    Select query (Access 2000)

    Can you give me advice ? I want to build a query showing customers that have bought in the previous years but who have not bought this year.Obiously paymentid should be 0 for 2008 but somehow I cannot build the rught query.Below is the query showing all the customers that have bought before 2008.
    But how to show the customers who have not bought this year ? I somehow cannot build it.Placing False below paymentid give me nothing relevant

    SELECT Customers.Customerid, Customers.CompanyName, orders.paymentid, orders.invoicedate
    FROM Customers LEFT JOIN orders ON Customers.Customerid = orders.customerid
    WHERE (((orders.invoicedate)<#1/1/2008#));

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

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

    Re: Select query (Access 2000)

    Try

    SELECT Customers.Customerid, Customers.CompanyName, orders.paymentid, orders.invoicedate
    FROM Customers LEFT JOIN orders ON Customers.Customerid = orders.customerid
    WHERE orders.invoicedate<#1/1/2008# AND Customers.Customerid Not In (SELECT
    customerid FROM orders WHERE invoicedate>=#1/1/2008#)

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

    Re: Select query (Access 2000)

    it works so great ! You are wonderful ! This query will be so useful to us, as a reminder in our actions. Thank you !

Posting Permissions

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