Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get all records except the latest
Message
 
 
To
30/10/2008 10:25:33
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01356683
Message ID:
01358370
Views:
28
>I cannot get it into one sql statement but here is a foxpro solution for the Date1 case:
>
>set enginebehavior 70
>
>select pk, max(Date1) from mytable where Flag=1 group by fk into cursor ctemp
>
>update mytable set Flag=0 where NOT pk in (select pk from ctemp)

I was thinking along these lines before, but may be because I was thinking too much or something I thought I can not do this this way. So I just went with SCAN/ENDSCAN solution.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform