Results 1 to 4 of 4
  1. #1
    hrghauri is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2016
    Location
    Ottawa, Ontario, Canada
    Posts
    11

    multiple fields with different criterias in query designer

    I am trying to design a query in Microsoft-access which should present the data in the following manner:

    HTML Code:
    CarMake                             Black                                           White                                             Red
                                 Total     2-door     4-door                  Total    2-door       4-door                    Total      2-door   4-door 
    --------------------------------------------------------------------------------------------------------------------------------------------------
    
    
    Honda                        4           2          2                       3          1            2                       4           3         1
    Toyota                       3           1          2                       5          3            2                       6           1         5
    Ford                         2           0          2                       0          0            0                       1           0         1
    
    
    Car Table:
     -CarMake "Short text"
     -Color "Short text"
     -Door "Short text" (2-door or 4-door)
    In Ms-Access query designer, I cant add more than one field which has a different criteria (for.eg white vs black). If I try to, it gives me nothing in the datasheet view (as if it tried to find a common car which is both white and black).


    Click image for larger version. 

Name:	Capture.PNG 
Views:	8 
Size:	5.8 KB 
ID:	25355



    This query will be the source of my report. If possible, please tell me the equivalent sql statement that I can use instead. Thank You.

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Try using a Crosstab query, might be what you need. You can turn that into a report.

    Honda 4 2 2 3 1 2 4 3 1 < what do these number represent, is 4 the number of 2door Black Hondas?

  3. #3
    hrghauri is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2016
    Location
    Ottawa, Ontario, Canada
    Posts
    11
    I have updated my post. Now youll be able to understand what the numbers represent.

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Maybe try to Group on Make, Color and and Door then do the count on Door? Also look at CrossTab Query, it takes the data and makes it look like a table like you have shown.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to search for multiple criterias using comboBox?
    By AccessPractice in forum Programming
    Replies: 2
    Last Post: 04-29-2016, 03:59 AM
  2. Query based on two different criterias
    By BRZ-Ryan in forum Queries
    Replies: 11
    Last Post: 12-22-2013, 09:25 PM
  3. Replies: 19
    Last Post: 08-01-2013, 10:47 AM
  4. Update Multiple fields according multiple criterias
    By denis.m in forum Programming
    Replies: 1
    Last Post: 02-21-2011, 11:03 AM
  5. Replies: 1
    Last Post: 09-19-2006, 11:07 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums