You can try something like

SELECT aa.account, aa.reference, aa.date, aa.value ;
FROM yourtable aa ;
WHERE aa.value > 0 AND ;
aa.account+aa.reference+DTOS(aa.date)IN ;
   SELECT ab.account+ab.reference+DTOS(ab.date) ;
    FROM yourtable ab WHERE ab.value <0) ;
INTO CURSOR myresult ;
UNION ;
SELECT ba.account, ba.reference, ba.date, ba.value ;
FROM yourtable ba ;
WHERE ba.value < 0 AND ba.account, ba.reference, ba.date, ba.valueIN ;
   SELECT bb.account+bb.reference+DTOS(bb.date) ;
    FROM yourtable bb WHERE bb.value >0)

I wrote it directly here and I didn't test it ! But it should give you the 
premice of a solution ...

HTH
The Foxil


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/4f26a435.7010...@wanadoo.fr
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to