Results 1 to 2 of 2

Thread: Help With Query

  1. #1
    Join Date
    Jun 2002

    Unanswered: Help With Query

    I have a table in the following format:

    CutomerID ; CustomerLasName ; PurchaseDate

    I would like to prepare a query with a ONE RECORD result and the following fields:

    #of customers; #of customers with last name X; #of customers with last name Y, #of purchase Dates ; a constant string such as market name

    All of this would be for the customerID's between aaa and bbb

    I would appreciate any help on this.

    t. Jones

  2. #2
    Join Date
    Oct 2001
    Bay Area, CA
    SELECT MarketName, Count(CustomerID), Sum(IIf([CustomerName]='x',1,0)) AS xName, Sum(IIf([CustomerName]='y',1,0)) AS yName, Count(PurchaseDate)
    FROM Customers
    GROUP BY MarketName;

    Hope this helps....

Posting Permissions

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