Results 1 to 2 of 2

Thread: Help With Query

  1. #1
    Join Date
    Jun 2002
    Location
    usa
    Posts
    1

    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
    Location
    Bay Area, CA
    Posts
    117
    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
  •