Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Pete Sass
  Where is Pete Sass?
 Marathon, Ontario
 Canada
 Pete Sass
 To: BZ Dusk
  
 
 
 BZ Dusk
 Tags
Subject: RE: DELETE RECORDS BETWEEN DATE RANGE INPUT BY ...
Thread ID: 16052 Message ID: 16097 # Views: 1 # Ratings: 0
Version: Unknown Category: General VFP Topics
Date: Tuesday, October 08, 2002 11:42:36 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 ...


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