Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Index, sort order question
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00806386
Message ID:
00806516
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
Hi Brenda,

You can do that with a query. I don't think it can be done with index because you don't have MinStartDate for each obligation in the table.
SELECT obligation, MIN(start_dt) AS MinStartDate ;
  FROM mytable ;
  WHERE comp_dt = {} ;
  GROUP BY 1 ;
  INTO CURSOR crsTemp 

SELECT ct.MinStartDate, mt.* ;
	FROM mytable mt ;
		JOIN crsTemp ct ON ct.obligation = mt.obligation ;
	ORDER BY ct.MinStartDate, mt.obligation, mt.seq
	INTO CURSOR crsResult
>I have a table of collateral items. The collateral items belong to an loan. The collateral table has the field obligation, seq, desc, start_dt, comp_dt. One obligation can have many collateral records, so the seq field is a numeric field that starts at 1 for each new obligation collateral item.
>
>I want to be sort the table records so that the "to do" items are shown first. Meaning that the records with the earliest start_dt that has an empty(compt_dt) should show first. But .... the obligation records need to stay together in a group by obligation, seq order.
>
>If I could accomplish this in an index that would be ideal.
>
>Any help would be appreciated.
>
>Brenda
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform