Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    300

    Question Unanswered: Count on Multiple Text Fields in Table

    In a Simple Query,
    I want to be able to Count the Text data in several Fields of a single Table. Ex: Shipping Field & Via & Pounds. I want a total of all "Rush" text in Shipping Field, "Truck" text in Via, and just a total # of pounds in Pounds (numeric)...

    I am using Count in each one and a ="Rush", ="Truck"... etc on the criteria lines but keep getting a Data Type Mismatch error

    What is the easy way to do this??? What am I doing wrong??

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Could you post the SQL or a screenshot of QBE?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Nov 2003
    Posts
    300
    SELECT Count(Shipped.POUNDS) AS CountOfPOUNDS, Count(Shipped.[SHIP SPECIAL]) AS [CountOfSHIP SPECIAL], Count(Shipped.TRANSPORT) AS CountOfTRANSPORT
    FROM Shipped
    HAVING (((Count(Shipped.[SHIP SPECIAL]))="RUSH") AND ((Count(Shipped.TRANSPORT))="TRUCK"));

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ah. Count() returns an integer. In your HAVING clause, you are comparing an integer to a string.

    Try something like this:

    HAVING ((Shipped.[SHIP SPECIAL]="RUSH") AND (Shipped.TRANSPORT="TRUCK"));
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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