Results 1 to 7 of 7
  1. #1
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283

    Query Help

    Hello,

    I need some help with a query where I need to make sure that there are 3 records of the same number in field Field1 and that each set of 3 records has to have a D, an R, and an S in the field Field2. So it should look like this:

    Field1 Field2
    1111 D
    1111 S
    1111 R

    1112 D
    1112 S


    1112 R

    And there are over a 1000 records. I need a way to make sure that there are 3 of each number in Field1 and that each set has D, S, and R in Field2.

    Thanks

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    if you have 1 query, Q1, that shows only unique FIELD1 , 1111,1112
    and
    have 1 query, Q2, that shows only unique FIELD2, D,S,R

    then make Q3 the has BOTH queries in the field BUT do not join them. (By not joining them it will multiply the 2 queries.)
    bring down Q1.FIELD1, & Q2.FIELD2 onto the grid.


    append to a table.

  3. #3
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    That worked! now how can I make sure that both tables are the same? or if something is missing?

  4. #4
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    I think you misunderstood what I'm trying to do, I need to validate the file that I imported that it has 3 of each number and D,S, and R for each of them. After making that other table is there a way to validate against the two tables?

  5. #5
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    yes, use this FULL table to join to the main table
    do an OUTER JOIN
    to see whats missing in your data table.

  6. #6
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    ah okay thank you sir. Also, can you show me how to create a query in the MainTable so there isnt a number having dublicates with Field2. for ex:

    Field1 Field2
    11111 D
    11111 D
    11111 S

  7. #7
    MTSPEER is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    283
    Nevermind I figured it out. thanks!

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

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