Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Christian Tabligan
  Where is Christian Tabligan?
 Bacolod City, Neg. Occ.
 Philippines
 Christian Tabligan
 To: Mike Yearwood
  Where is Mike Yearwood?
 Toronto
 Canada
 Mike Yearwood
 Tags
Subject: RE: order by deleted()
Thread ID: 268652 Message ID: 268847 # Views: 29 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: VFP and .NET
Date: Thursday, July 15, 2010 2:01:50 AM         
   


> >
> > hope this help.
> >
> >
> > set safety off
> > create table temp (letter c(1))
> > insert into temp values ("A")
> > insert into temp values ("B")
> > insert into temp values ("C")
> > insert into temp values ("D")
> > insert into temp values ("E")
> > insert into temp values ("F")
> > delete from temp where inlist(letter, 'A', 'C', 'F')
> > set deleted off
> > select *, "INACTIVE" as cStatus from temp where deleted();
> > union all;
> > select *, "ACTIVE" from temp where !deleted()
> > 

> >
> > If you are using My Sql, i suggest that you put another field to identify what record has been deleted or not.
> >
> > Sample:
> >
> > select * from YourTable where cStatus == "INACTIVE";
> > union all;
> > select * from YourTable where cStatus == "ACTIVE"
> > 

> >
> > Best Regards,
> >
> > CriZ (,")
> >
> > "Happiness is real when shared."
>
> It would be much much better to use a datetime field for cStatus. That way you can recall records deleted by a user on the day they got fired. You can really delete records that are more than a year old, etc.

In my case, i rather use status, and date of transaction. So that i could identify what date the transaction occurred. You cannot just delete records in the master table that are more than a year most especially if the record exists in the master table because not all records which exists more than a year is "INACTIVE".

Best Regards,

CriZ (,")

"Happiness is real when shared."

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