Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Master-Detail-Problem.

edited November 2001 in General
Hi,

I have two tables, one specifies ranges in time (start-end), the other one
events that happened at a specific time.

Now I would like to create a report that prints the range followed by all
the events that fall into that range. To make things interesting an event
may fall into two or more ranges or of course none at all.

So given Tables like:

Ranges:
A 12:00-13:00
B 13:00-15:00
C 14:00-16:00

and Events

a 11:30
b 12:30
c 13:30
d 14:30
e 15:30
f 16:30

Should generate a report like

A:
b
B:
c
d
C:
d
e

the Events a and f never print, because there is no range for them.

Two questions:

One: Is it possible to create that report in end-user-land completely
(given access to the two tables of course) or ist ist mandatory that I make
provisions for it in my design-time-code?

Two: If the latter, what would be the best approach?

Ciao, MM
--
Marian Aldenhövel, Hainstraße 8, 53121 Bonn
http://www.marian-aldenhoevel.de
"Wussten Sie, daß schon der Biss eines einzigen
Pferdes eine Hornisse töten kann?"

Comments

  • edited November 2001
    DADE won't let you link a detail dataview to a range of values on the master
    dataview.

    You'll have to create a joined query for this. The end user, or you, can
    create a single dataview and edit the SQL to create a joined query such that
    it will select records from the Events table based on a range between the
    Range.Start and Range.End. Something like this perhaps:

    SELECT * FROM Range, Event
    WHERE ((Event.Time > Range.Start) and (Event.Time < Range.End))
    ORDER BY Range.Start


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited November 2001
    Hi,


    And then group on the ID-Field of the Range or (in absence of any
    additional Data in the Table Range) even Range.Start.

    Yes, that works nicely and without a line of application-code. Neat.

    Ciao, MM
    --
    Marian Aldenhövel, Hainstraße 8, 53121 Bonn
    http://www.marian-aldenhoevel.de
    "Wussten Sie, daß schon der Biss eines einzigen
    Pferdes eine Hornisse töten kann?"
This discussion has been closed.