sorting portal records

sorting portal records

am 15.09.2007 00:37:50 von FastWolf

I have a join table (t_join) making a portal between two data tables
(t_draft and t_final):

t_draft fields are:
draft_id (auto-enter serial)
draft_name (text)

t_final fields are:
final_id (auto-enter serial)
final_name (text)

t_join fields are:
join_id (auto-enter serial)
draft_id (number)
final_id (number)

They're joined like this:

t_join::draft_id = t_draft::draft_id
t_join::final_id = t_final::final_id


.... where t_draft and t_final each has a one-to-many relationship with
t_join:

t_draft --< t_join >-- t_final


What I need is a script step[s] that will sort the records in t_draft
by the total number of times draft_id appears in t_join.

thanks in advance

--
FW

FM Pro 8.5 on Windows XP Pro, connecting to
FM Server 8.0 on Windows 2003 Server

Re: sorting portal records

am 15.09.2007 17:01:54 von ursus.kirk

"FastWolf" schreef in bericht
news:d33me3p7ius8af7kvbql30gbl7pkp64r6g@4ax.com...
>I have a join table (t_join) making a portal between two data tables
> (t_draft and t_final):
>
> t_draft fields are:
> draft_id (auto-enter serial)
> draft_name (text)
>
> t_final fields are:
> final_id (auto-enter serial)
> final_name (text)
>
> t_join fields are:
> join_id (auto-enter serial)
> draft_id (number)
> final_id (number)
>
> They're joined like this:
>
> t_join::draft_id = t_draft::draft_id
> t_join::final_id = t_final::final_id
>
>
> ... where t_draft and t_final each has a one-to-many relationship with
> t_join:
>
> t_draft --< t_join >-- t_final
>
>
> What I need is a script step[s] that will sort the records in t_draft
> by the total number of times draft_id appears in t_join.
>
> thanks in advance
>
> --
> FW
>
> FM Pro 8.5 on Windows XP Pro, connecting to
> FM Server 8.0 on Windows 2003 Server
>
>

Create one calc field in t_draft
cCount < Number ; count ( t_join::draft_id) >
This gives a number of how many times the t_draft_id is related to
t_join::draft_id. You can then sort on this number. Same goes for t_join &
t_final when needed.

Keep well, Ursus

Re: Re: sorting portal records

am 17.09.2007 23:16:36 von FastWolf

On Sat, 15 Sep 2007 17:01:54 +0200, "Ursus"
wrote:

>
>"FastWolf" schreef in bericht
>news:d33me3p7ius8af7kvbql30gbl7pkp64r6g@4ax.com...
>>I have a join table (t_join) making a portal between two data tables
>> (t_draft and t_final):
>>
>> t_draft fields are:
>> draft_id (auto-enter serial)
>> draft_name (text)
>>
>> t_final fields are:
>> final_id (auto-enter serial)
>> final_name (text)
>>
>> t_join fields are:
>> join_id (auto-enter serial)
>> draft_id (number)
>> final_id (number)
>>
>> They're joined like this:
>>
>> t_join::draft_id = t_draft::draft_id
>> t_join::final_id = t_final::final_id
>>
>>
>> ... where t_draft and t_final each has a one-to-many relationship with
>> t_join:
>>
>> t_draft --< t_join >-- t_final
>>
>>
>> What I need is a script step[s] that will sort the records in t_draft
>> by the total number of times draft_id appears in t_join.
>>
>> thanks in advance
>>
>> --
>> FW
>>
>> FM Pro 8.5 on Windows XP Pro, connecting to
>> FM Server 8.0 on Windows 2003 Server
>>
>>
>
>Create one calc field in t_draft
>cCount < Number ; count ( t_join::draft_id) >
>This gives a number of how many times the t_draft_id is related to
>t_join::draft_id. You can then sort on this number. Same goes for t_join &
>t_final when needed.

Many thanks, Ursus, this works like a charm.

--
FW