Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need SQL to find LATEST child record
Message
De
15/04/2003 11:28:55
 
 
À
15/04/2003 10:49:10
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00777700
Message ID:
00777798
Vues:
15
Cetin,
I tried it. I did not get ANY recs so I changed the INNER JOIN to be ON a.cid = b.cinmates_id because I believe that is what you meant. Now, I get ALL the OPEN records from ACCT_EVENTS. Again, (perhaps I am not stating it correctly), I need all recs from INMATES where LASTEST rec in ACCT_EVENTS status = OPEN.

select a.cid, a.cinmate_number, ;
b.cinmates_id, b.ttxndatetm, b.txnstatus ;
from INMATES a ;
inner join ACCT_EVENTS b ;
on a.cid = b.cinmates_id ;
where ttoc(b.ttxndatetm,1) = ;
(select max(ttoc(ttxndatetm,1)) from ACCT_EVENTS c ;
where b.cid = c.cid and c.txnStatus= 'OPEN')

Thanks,
John
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform