Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting the Maximum
Message
De
01/04/2001 09:34:42
 
 
À
01/04/2001 08:49:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00490711
Message ID:
00490721
Vues:
20
Hi John,
Try another select statement, something like the following:
SELECT tmpParts.PartId, tmpParts.Length;
    FROM tmpParts;
    WHERE tmpParts.Cut = .F. AND tmpParts.Length < tmpMatList.NotUsed;
    ORDER BY 2 DESC;
    TOP 1;
    INTO ARRAY laPart
Alex

>I am trying to select one numeric field from a table that is the largest but not larger than a limit and its record id. So far I get the partid from the last record not the max record... What am I doing wrong?
>
>
>SELECT tmpParts.PartId, MAX(tmpParts.Length);
>  FROM tmpParts;
>  WHERE tmpParts.Cut = .F. AND tmpParts.Length < tmpMatList.NotUsed;
>  INTO ARRAY laPart
>
>
>
>TIA
Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform