Board index » delphi » Master-Detail with descending detail sort

Master-Detail with descending detail sort

Hi,

How do I set up a master-detail relationship and have the detail table
sort descending on a field which is not the field I use for the
master-detail link.

Example:

Customer table (with field Customer ID) - Master
Invoice table (with fields Customer ID and Invoice Number) - Detail

Master-Detail link: via Customer ID
Required sort: Descending sort on Invoice Number

Please help, I'm lost on this one...

Jon

--
Jonathan Edwards
Scientist, Information Systems

Uppsala Monitoring Centre
(WHO Collaborating Centre for International Drug Monitoring)
Stora Torget 3
753 20 Uppsala
Sweden

Phone: +46 18 656064
Fax: +46 18 656080

 

Re:Master-Detail with descending detail sort


Quote
>How do I set up a master-detail relationship and have the detail table
>sort descending on a field which is not the field I use for the
>master-detail link.

That is not possible.  The detail table always sorts on the linking index.  You
can change the linking index

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Master-Detail with descending detail sort


Jon,

What database are you using?  In Paradox
(Paradox 7 level tables - earlier ones don't support descending
indexes) I don't have any problem with this.  I set up a secondary
index that, in your example, is ascending on Customer ID and
descending on Invoice number.  Link to the master table on this index
and you get the details in the order that you want them.

-Dell

On Tue, 21 Jul 1998 23:32:44 +0200, Jonathan Edwards

Quote
<jonathan.edwa...@who.pharmasoft.se> wrote:
>Hi,

>How do I set up a master-detail relationship and have the detail table
>sort descending on a field which is not the field I use for the
>master-detail link.

>Example:

>Customer table (with field Customer ID) - Master
>Invoice table (with fields Customer ID and Invoice Number) - Detail

>Master-Detail link: via Customer ID
>Required sort: Descending sort on Invoice Number

>Please help, I'm lost on this one...

>Jon

>--
>Jonathan Edwards
>Scientist, Information Systems

>Uppsala Monitoring Centre
>(WHO Collaborating Centre for International Drug Monitoring)
>Stora Torget 3
>753 20 Uppsala
>Sweden

>Phone: +46 18 656064
>Fax: +46 18 656080

_________________________________________________
Program:  A magic spell cast over a computer
allowing it to turn one's input into error messages

Other Threads