Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need SQL to find LATEST child record
Message
 
 
À
15/04/2003 11:00:04
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:
00777792
Vues:
19
>Hi Sergey,
>Thanks for the input.
>I have attempted to modify as required and this is where I am at. I get the error:
>SQL: Queries of this type are not supported.
>
>SELECT inmates.cid, inmates.cinmate_number, acct_events.tdatetm, acct_events.cstatus ;
> FROM acct_events, inmates;
> WHERE inmates.cid + TTOC(acct_events.tdatetm,1) IN ( ;
> SELECT acct_events.cid + TTOC(MAX(acct_events.tdatetm),1) ;
> FROM acct_events ;
> GROUP BY cid) ;
> INTO CURSOR crsLastEven NOFILTER

Try
SELECT cid, cinmates_id, ttxndatetm, txnstatus ;
  FROM acct_events ;
  WHERE cid + TTOC(ttxndatetm,1) IN ( ;
               SELECT cid + TTOC(MAX(ttxndatetm),1) ;
               FROM acct_events ;
               GROUP BY cid) ;
    AND txnstatus = "OPEN"  ;
  INTO CURSOR LastEvent NOFILTER
SELECT inmates.cid, inmates.cinmate_number, LastEvent.* ;
  FROM inmates ;
    JOIN LastEvent ON LastEvent.cinmates_id = inmates.cid ;
  INTO CURSOR crsResult
You can use < pre > and < /pre > tags (no spaces) to preserve formatting.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform