Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Select records with Maximum date group by address
Message
From
02/10/2002 09:13:49
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00705983
Message ID:
00706820
Views:
22
>I don't understand if you use Sql Server or VFP (Sql server not suport into table and VFP not support Var=SubQuery, i check it with VFP 6)
>
>If this is with VFP, the first sql must work, simply add the adrres&max date fields in Order and group by. Is a basic rule of groupping... Only adding the adrees never work

Mario,
Sorry couldn't understand exactly what you mean.
In VFP you CAN DO :
var = subquery

But it's not always as painless as it does in SQL server.

It does work with only returning a field that you want or any one of them. You do the group by in subquery not main OR better yet don't do any group by. ie:
select * from myTable t1 ;
  where myDate = (select max(mydate) from myTable2 ;
                  where t1.PK = t2.PK)
You might check a better sample on foxyclasses site (tips page).
Cetin


Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform