Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yousfi Benameur
  Where is Yousfi Benameur?
 El Bayadh
 Algeria
 Yousfi Benameur
 To: Adam Walan
  Where is Adam Walan?
 Chicago
 Illinois - United States
 Adam Walan
 Tags
Subject: RE: order by deleted()
Thread ID: 268652 Message ID: 268655 # Views: 38 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: VFP and .NET
Date: Tuesday, July 13, 2010 7:40:57 PM         
   


> Hi,
> Is tehere a simple way to sort my cursor and display deleted records on the top ? I tried
> SELECT .... order by deleted()
>
> but this is giving me an eror.
>
> Thanks,

I try to help you (i dont work with world tables).try this test code
create cursor ycurs (nom c(20), num i)
FOR I=1 TO 20
insert into ycurs values ("AZERTYUUUUUUUUUU2",I)
endfor

scan
delete for mod(recno(),2)=0
endscan

set deleted on
index on deleted() tag  ydeleted descending
set order to ydeleted
brow
set deleted off
brow

SET DELETED is scoped to the current data session.
ON
Specifies that commands that operate on records, including records in related tables, using a scope ignore records that are marked for deletion.

OFF
Specifies that commands that operate on records, including records in related tables, using a scope can access records marked for deletion. (Default)
Also ,table can be indexed on DELETED( ).
Regards
Yousfi Benameur

ENTIRE THREAD

order by deleted() Posted by Adam Walan @ 7/13/2010 7:19:47 PM
RE: order by deleted() Posted by Yousfi Benameur @ 7/13/2010 7:40:57 PM
RE: order by deleted() Posted by Adam Walan @ 7/13/2010 7:55:29 PM
RE: order by deleted() Posted by Mike Yearwood @ 7/13/2010 10:21:48 PM
RE: order by deleted() Posted by Christian Tabligan @ 7/14/2010 7:12:26 AM
RE: order by deleted() Posted by Mike Yearwood @ 7/14/2010 7:40:53 PM
RE: order by deleted() Posted by Christian Tabligan @ 7/15/2010 2:01:50 AM
RE: order by deleted() Posted by Mike Yearwood @ 7/15/2010 7:05:59 AM
RE: order by deleted() Posted by Christian Tabligan @ 7/15/2010 7:48:55 AM
RE: order by deleted() Posted by Mike Yearwood @ 7/15/2010 6:50:28 PM