Results 1 to 6 of 6
  1. #1
    ariklewis is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7

    Sub Query

    I have two tables



    Code:
    ID	Job#	Piece Mark	Description	Quantity	Length
    1	2847	10AP1	W10X47	10	12
    2	2847	10AP2	W11X35	8	10
    Code:
    ID	Major	Piece Mark	Description	Quantity	Length
    1	1	a10	pl2x2	5	4
    2	1	b10	pl2x2	4	4
    3	2	a10	pl2x2	6	3
    4	2	b10	pl2x2	2	3
    The result I'm looking for is something along the lines of:

    Code:
    Job#	Piece Mark	Description	Quantity	Length
    2847	10AP1	W10X47	10	12
    2847	a10	pl2x2	5	4
    2847	b10	pl2x2	4	4
    2847	10AP2	W11X35	8	10
    2847	a10	pl2x2	6	3
    2847	b10	pl2x2	2	3
    How can I achieve this?

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    What is your connection between the two source tables?

  3. #3
    ariklewis is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    The connection is one Major (First Table) to many Detail (Second Table)

  4. #4
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    I dont see "Detail" as a field in either table

    Further, is there a reason why the same type of data is being held in multiple tables? The only difference I see in those tables is Major and Job #. Is there any reason they cant exist in one table?

  5. #5
    ariklewis is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    The name of the first Table is Major containing major piece marks. The second is Detail containing detail piece marks. Each item in the Major table has components (detail piece marks). The column "Major" in the 2nd or Detail table relates to which Major piece mark those detail piece marks belong to. When a major piece mark is updated, each detailed piece that correlates to that major needs to be updated. That's why they are separate. The job# field is just to connect them to a job. The relationship is one Job# to many Major and one Major to many Detail. But I don't think that the job table is needed for this query.

  6. #6
    ariklewis is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    7
    Does anyone know how this can be done?

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