Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select max(fkey) from table into array lavalue
Message
 
To
31/01/2006 03:24:50
Ken Knorr
Logos Management Software
Ventura, California, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01091785
Message ID:
01091791
Views:
12
Ken,
I asked that question before and Sergey points me to HELP. Unfortunately I coudn't find the thread so check SET ENGINEBEHAVIOR in HELP especialy the section 90 and GROUP BY. It says:

GROUP BY
When using aggregate functions, such as MAX( ), in the SQL SELECT command without a GROUP BY clause, and no matching records are found, Visual FoxPro returns a result set with a single record and _TALLY set to 1. In versions prior to Visual FoxPro 9.0, no records are returned, and _TALLY is set to 0.



>In vfp 8 i would get the max integer key value in a table with:
>
>local lavalue[1]
>lavalue = .f.
>select max(fkey) from table into array lavalue
>
>lavalue[1] would return .f.
>
>in Vfp 9 sp1 this returns .NULL.
>
>I can change the select statement to
>select max(fkey) from table group by fkey into array lavalue
>
>and lavalue[1] will return .f.
>
>
>Code to test this
>
>create cursor ken (fkey I)
>local lavalue[1]
>
>lavalue = .f.
>select max(fkey) from ken into array lavalue
>? lavalue[1]
>
>I don't remember having this problem in Vfp 9
>has any one else had this problem?
>
>Ken
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform