Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: munir hossain
  Where is munir hossain?
 dhaka
 Bangladesh
 munir hossain
 To: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 Tags
Subject: RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ...
Thread ID: 16052 Message ID: 16123 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Wednesday, October 09, 2002 5:11:01 PM         
   


> > > > > Hello Expert,
> > > > >
> > > > > I WANT TO DELETE RECORDS FROM A TABLE BETWEEN TWO DATE RANGE( LIKE 09/12/01 TO 10/12/01)
> > > > > AND ADD A CONDITION LIKE PEOPLE WHO LIVE IN "CA" AND I WANT TO INPUT THOSE VALUES
> > > > > (TWO DATES AND PLACE NAME = "CA" ) BY FORM(FORM HAS THREE TEXT BOXS AND ONE COMMAND BUTTON ).
> > > > > PLEASE TELL ME HOW IAM GONNA DO IT.
> > > > > THANKS FOR YOUR LAST SOLVEMENT.
> > > > >
> > > > >
> > > >
> > > > Hi!
> > > >
> > > > I'm not an expert but i hope this will help -
> > > >
> > > > SELECT MYTABLE
> > > > DELETE ALL FOR BETWEEN(dDatefield,ctod('09/12/01'),ctod('10/12/01'))
> > > >
> > > > BZ
> > >
> > > Hi,
> > > If you want to delete dates including the dates entered......
> > >
> > > SELECT MyTable
> > > DELETE ALL FOR dDatefield >= CTOD(startdateinput) .AND. dDatefield <= CTOD(enddateinput) .AND. ; PLACENAME==cState
> > >
> > > You should validate the entries to enforce that date ranges outside you parameters are not
> > > violated. And possibly put the states in a dropdown list combo box bound to a table of all states.
> > > You may only wish users to delete dates for 1 month at a time... as a limit. These kinds of
> > > validations would be in the commandbutton you use to execute once the user enters all the
> > > input.
> > >
> > > I am not sure what the rest of the world is doing but we here have standardized out dates in
> > > out startup (Main.prg) to be.
> > > SET DATE ANSI
> > > SET CENTURY ON
> > > Thus all dates are displayed in the yyyy.mm.dd format.
> > > 2002.10.24
> > > 2002.10.25
> > > 2002.10.26
> > >
> > > Many pros and cons to how to use dates... but this is what we have gone with.
> > >
> > > Pete from the Great White North ! (Only in Canada, ay...) Over and Out ...
> >
> >
> > NOW IF I WANT TO PUT OPTION CONTROL IN THAT FORM AND WANT TO GIVE USER CHOICE BETWEEN
> > DELETE ALL RECORDS WITHIN A DATE RANGE OR DELETE ALL RECORDS FOR SELECTED PLACENAME LIKE "CA".
> > WHAT CODE I SHOULD WRITE AND WHERE?
> > (mY FORM HAS TWO TEXT BOX FOR DATE RANGE,ONE TEXT BOX FOR PLACENAME, ONE OPTION CONTROL,ONE
> > COMMAND BUTTON.)
> >
> >
> >
>
> Hi,
> Two command buttons... One validating the date ranges and the state selection, and another command button named "Delete All by Dates". Again be careful, prone to losing records due to user input.
> One thing you may want to consider... to protect against records being actually deleted in error and control over
> getting them back. Have one additional field in the table called something like "Deleted" and have this set as a datetime field. In the indexes on the table have all them set having a filter testing for a blank value in the field called Deleted. Thus any records with any value in the Deleted field will not show. Now when your user goes to delete the records all they really will be doing is date and time stamping the Deleted field. In the even a gross error is done in the deletions you can roll back this simply by know the date and time and setting these records back to a null value in the Deleted field. Once a month you can delete all for data in the Delete field and pack if you wish.
> Note: All other forms and reports will have to use indexes using with the Deleted field filter.
>
> Pete from the Great White North ! (Only in Canada, ay...) Over and Out ...



But i want to use option group control to select between delete all and delete all where placename= "ca"(Input by form text box)
is that possible? If so, How
Thanks





ENTIRE THREAD

DELETE RECORDS BETWEEN DATE RANGE INPUT BY FORM Posted by munir hossain @ 10/8/2002 7:03:33 AM
RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ... Posted by BZ Dusk @ 10/8/2002 8:12:41 PM
RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ... Posted by Pete Sass @ 10/8/2002 11:42:36 PM
RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ... Posted by munir hossain @ 10/9/2002 9:34:14 AM
RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ... Posted by Pete Sass @ 10/9/2002 1:54:21 PM
RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ... Posted by munir hossain @ 10/9/2002 5:11:01 PM