Code Comments
Programming Forum and web based access to our favorite programming groups.I have 2 database to add-in date as structure below with selection by user. When user key in a input of from date & to date structure below shall be app ended to both database. Eg: User may input range as 01/01/2005 to 31/12/2005 or 01/01/2005 to 31/08/ 2009 Any fast method to achieve this?. Database1 - Stru FDATE TDATE CUDATE WEEK_DAY 01/05/2005 31/05/2005 01/05/2005 Sunday 01/05/2005 31/05/2005 02/05/2005 Monday 01/05/2005 31/05/2005 03/05/2005 Tuesday 01/05/2005 31/05/2005 04/05/2005 Wednesday 01/05/2005 31/05/2005 05/05/2005 Thursday 01/05/2005 31/05/2005 06/05/2005 Friday 01/05/2005 31/05/2005 07/05/2005 Saturday 01/05/2005 31/05/2005 08/05/2005 Sunday Database2 - Stru CUDATE WEEK_DAY FLAG 01/05/2005 Sunday Y 02/05/2005 Monday Y 03/05/2005 Tuesday Y 04/05/2005 Wednesday Y 05/05/2005 Thursday Y 06/05/2005 Friday Y 07/05/2005 Saturday Y 08/05/2005 Sunday Y Thanks in advance Regards Benny
Post Follow-up to this messageBenny @ 1, 15 GET FromDate PICTURE '@E' @ 2, 15 GET ToDate PICTURE '@E' dDate := FromDate - 1 FOR i := 1 TO 8 DB1->( DBAPPEND() ) DB2->( DBAPPEND() ) DB1->FDATE := FromDate DB1->TDATE := ToDate dDate += 1 DB1->CUDATE := dDate DB2->CUDATE := dDate cDay := DOW( dDate ) DB1->WEEK_DAY := cDay DB2->WEEK_DAY := cDay DB2->FLAG := .T. (or 'Y' ) NEXT HTH Steve
Post Follow-up to this messageBenny @ 1, 15 GET FromDate PICTURE '@E' @ 2, 15 GET ToDate PICTURE '@E' dDate := FromDate - 1 FOR i := 1 TO 8 DB1->( DBAPPEND() ) DB2->( DBAPPEND() ) DB1->FDATE := FromDate DB1->TDATE := ToDate dDate += 1 DB1->CUDATE := dDate DB2->CUDATE := dDate cDay := DOW( dDate ) DB1->WEEK_DAY := cDay DB2->WEEK_DAY := cDay DB2->FLAG := .T. (or 'Y' ) NEXT HTH Steve
Post Follow-up to this messageSteve Thanks for the inputs. "Stephen Quinn" <steveqNOSPAM@integritynet.com.au> wrote in message news:<d6p0f1$ag3$1@domi tilla.aioe.org>... > Benny > > @ 1, 15 GET FromDate PICTURE '@E' > @ 2, 15 GET ToDate PICTURE '@E' > > dDate := FromDate - 1 > FOR i := 1 TO 8 > DB1->( DBAPPEND() ) > DB2->( DBAPPEND() ) > > DB1->FDATE := FromDate > DB1->TDATE := ToDate > > dDate += 1 > DB1->CUDATE := dDate > DB2->CUDATE := dDate > > cDay := DOW( dDate ) > DB1->WEEK_DAY := cDay > DB2->WEEK_DAY := cDay > > DB2->FLAG := .T. (or 'Y' ) > NEXT > > HTH > Steve
Post Follow-up to this messageBenny @ 1, 15 GET FromDate PICTURE '@E' @ 2, 15 GET ToDate PICTURE '@E' dDate := FromDate - 1 FOR i := 1 TO 8 DB1->( DBAPPEND() ) DB2->( DBAPPEND() ) DB1->FDATE := FromDate DB1->TDATE := ToDate dDate += 1 DB1->CUDATE := dDate DB2->CUDATE := dDate cDay := DOW( dDate ) DB1->WEEK_DAY := cDay DB2->WEEK_DAY := cDay DB2->FLAG := .T. (or 'Y' ) NEXT HTH Steve
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.