>>I need an expression that locates the MAX number in a field among a given set of records of another field. (Like the MAX levelNo among codeNo=1.)Ed Rauh kindly gave me this:
>>
>>SELECT MAX(LevelNo) AS MaxLevelNo FROM MyTable WHERE CodeNo = 1 ;
>>INTO CURSOR whatever
>>
>>however this causes my grid to go blank afterwards. Is it posibble to construct a LOCATE sentence that do this? I need badly a way to solve this problem.
>>Thank you very much.
>>
>>Ulises
>
>
>Try this:
>
>SELECT MAX(LevelNo) AS MaxLevelNo FROM MyTable WHERE CodeNo = 1 ;
>INTO array laMaxValue
>
>sele MyTable &&assuming this is the table behind your grid
>loca for LevelNo = laMaxValue[1]
Change this to
LOCATE FOR LevelNo = laMaxValue[1] and CodeNo = 1