Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Selecting the Maximum
Message
From
01/04/2001 09:34:42
 
 
To
01/04/2001 08:49:28
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00490711
Message ID:
00490721
Views:
19
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform