Home DADE

One Master, Two Detail

edited September 2004 in DADE
Hi there,

I need to link two detail queries to one master, but I only want the master
record if there is a detail in one or both details. I've selected "Include
only those records from master if there is a detail" on the link dialog, but
it doens't seem to work for me. I assume this is because I've got two
detail linked to the master?

Am i missing something?

Reportbuilder 7.04, Delphi 7.

Leah

Comments

  • edited September 2004

    I performed a simple test using the DBDemos database. I created a master
    query that selects all customer records. I created two detail queries on
    orders. I linked the detail queries to the same master. I added search
    criteria to each detail query to select a different customer - 1221 and
    1351. That is the only two master records that print.

    Try the same test and perhaps modify it and send a simple example to
    support@digital-metaphors.com in zip format that we can see exactly what is
    happening.


    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited September 2004
    Thanks, but I think my problem is related to key fields. My detail queries
    are linked to the master by fields that aren't key fields. Could this be
    the problem?

    When I link one of the detail tables to the master in the same query, the
    results are as expected, but because I need a second detail query, I can't
    include them both in the master query.


  • edited September 2004

    I do not understand. In my example, Orders are linked to Customer. The
    linking field is CustNo - which is a unique identifier or key for the rows
    of the master query. This is required. It is possible to define a link on
    multiple fields that together uniquely identify a row in the master query
    (i.e. a compound key). For example CompanyName, ZipCode might uniquely
    identify a customer.

    Perhaps you can provide a concrete example as I have done here.



    --
    Nard Moseley
    Digital Metaphors Corporation
    www.digital-metaphors.com



    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.