Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: mk sharma
  Where is mk sharma?
 mumbai
 India
 mk sharma
 To: Anil Sharma
  Where is Anil Sharma?
 ludhiana
 India
 Anil Sharma
 Tags
Subject: RE: how to optimize/fast this
Thread ID: 268658 Message ID: 268670 # Views: 49 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Databases, Tables and SQL Server
Date: Tuesday, July 13, 2010 8:59:49 PM         
   


i have stored required records in a cursor wstkrep and generated a stock report

if the date is less 01-04-2010 then add/less in opening otherwise new record as inward/outward/wastage



---------------------------------------------------------------------------------------------
Date   |  Opening        |      Inward      |     Outward     | Wastage   |      Balance
       |-------------------------------------------------------------------------------------
       |  cat.1  | Cat.2 |  cat.1  | Cat.2  |  cat.1  | Cat.2 |           |  cat.1  | Cat.2 |
---------------------------------------------------------------------------------------------


warm regards,
mk.



> > the below program takes 25 seconds to generate the result total 26500 records in inward1.dbf
> > how i can make this fast
> > not network only running on single machine
> >
> > attachment is one tryprg.prg and datafiles
> >
> > part001.rar
> > part002.rar
> > part003.rar
> > part004.rar
> > part005.rar
> > part006.rar
> > part007.rar
> >
> >
> > 
> > USE IN SELECT('yinrep')
> > SELECT inward
> > SET ORDER TO billno
> > *SET ORDER TO reco1
> > SET FILTER TO (STATUS='BO' OR STATUS='BJ' OR STATUS='RB') AND NOT DELETED()
> > GOTO TOP
> > USE zdatapath+'inward1' AGAIN IN SELECT('inward12') ALIAS inward12
> > SELECT inward12
> > SET ORDER TO reco1
> > SET FILTER TO (STATUS='BO' OR STATUS='BJ' OR STATUS='RB') AND NOT DELETED()
> > 
> > USE zdatapath+'inward1' AGAIN IN SELECT('inward12bo') ALIAS inward12bo
> > SELECT inward12bo
> > SET ORDER TO beamno
> > SET FILTER TO (STATUS='BO' OR STATUS='BJ') AND NOT DELETED()
> > 
> > USE zdatapath+'inward' AGAIN IN SELECT('inwardbo') ALIAS inwardbo
> > SELECT inwardbo
> > SET ORDER TO billno
> > SET FILTER TO (STATUS='BO' OR STATUS='BJ' OR STATUS='RB') AND NOT DELETED()
> > 
> > USE zdatapath+'inward1' AGAIN IN SELECT('inward12bi') ALIAS inward12bi
> > SELECT inward12bi
> > SET ORDER TO beamno
> > *SET FILTER TO STATUS='BO' OR STATUS='BJ' OR STATUS='RB'
> > 
> > SELECT inward1
> > SET ORDER TO DATE
> > SET FILTER TO NOT DELETED()
> > GOTO TOP
> > LOCAL xxval1, xxval2, xxval3
> > SYS(3054,1,"cmemvar")
> > xxval1=1
> > xxval2=1
> > xxval3=RECCOUNT()
> > USE IN SELECT('wstkrep2')
> > USE IN SELECT('wstkrep')
> > CREATE TABLE wstkrep (DATE d, dno c(26), pcode c(6), igroup c(35), beamno c(8), LOOMNO c(4), ;
> > accode c(7), millcode c(7), lotno c(10), ctnno c(10), ;
> > opbal N(10,3), opbalweft N(10,3), opbalwarp N(10,3), stkin N(10,3), stkinweft N(10,3), ;
> > stkinwarp N(10,3), prodin N(10,3), retin N(10,3), ;
> > retout N(10,3), retoutweft N(10,3), retoutwarp N(10,3), issout N(10,3), ;
> > issoutweft N(10,3), issoutwarp N(10,3), wast N(10,3),STATUS c(2),REM1 c(20))
> > SELECT wstkrep
> > INDEX ON DATE TO wstkrep2
> > INDEX ON accode+pcode+DTOS(DATE) TO wstkrep1
> > SELECT inward1
> > SET ORDER TO DATE
> > SET FILTER TO INLIST(inward1.STATUS,'BI','RB','IW','IS','RW','RS','WW','SW','G1','G2','G3','G4') AND NOT DELETED()
> > GOTO TOP
> > DO WHILE NOT EOF('inward1')
> >    IF xxval1=xxval2
> >       WAIT WINDOW AT SROWS()/2, SCOLS()/2 NOWAIT ALLTRIM(STR(xxval1))+" ...Working... "+ALLTRIM(STR(xxval3))
> >       xxval1=xxval1+1000
> >    ENDIF
> >    IF INLIST(inward1.STATUS,'BI','RB','IW','IS','RW','RS','WW','SW','G1','G2','G3','G4')
> >       DO CASE
> >       CASE inward1.DATE<rep.ldate
> >          mkey=inward1.accode+inward1.pcode+DTOS(rep.ldate-1)
> >          IF INLIST(inward1.STATUS,'RB','IW','IS','RW','RS','WW','SW')
> >             IF NOT SEEK(mkey,'wstkrep','wstkrep1')
> >                APPEND BLANK IN wstkrep
> >                REPLACE ;
> >                wstkrep.DATE WITH rep.ldate-1, ;
> >                wstkrep.pcode WITH inward1.pcode, ;
> >                wstkrep.accode WITH inward1.accode ;
> >                IN wstkrep
> >             ENDIF
> >          ENDIF
> > 
> >          DO CASE
> > 
> >          CASE INLIST(inward1.STATUS,'IW','IS')
> >             REPLACE opbal WITH opbal+inward1.weight IN wstkrep
> >             REPLACE opbalweft WITH opbalweft+inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'RS','RW')
> >             REPLACE opbal WITH opbal-inward1.weight IN wstkrep
> >             REPLACE opbalweft WITH opbalweft-inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'WW','SW')
> >             REPLACE opbal WITH opbal-inward1.weight IN wstkrep
> >             REPLACE opbalweft WITH opbalweft-inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'RB')
> >             REPLACE opbal WITH opbal-inward1.beamwt IN wstkrep
> >             REPLACE opbalwarp WITH opbalwarp-inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'G1','G3')
> >             LOCAL xxcutbal, xxwtbal
> >             STORE 0 TO xxcutbal, xxwtbal
> >             IF SEEK(inward1.beamno,'inwardbo','billno')
> >                DO WHILE inwardbo.billno=inward1.beamno AND NOT EOF('inwardbo')
> >                   DO CASE
> >                   CASE inwardbo.issucode=inward1.accode AND INLIST(inwardbo.STATUS,'BO','BJ','RB')
> >                      xxcutbal=xxcutbal+inwardbo.totcut
> >                      xxwtbal=xxwtbal+inwardbo.beamwt
> >                   CASE inwardbo.accode=inward1.accode AND inwardbo.STATUS='RB'
> >                      xxcutbal=xxcutbal-inwardbo.totcut
> >                      xxwtbal=xxwtbal-inwardbo.beamwt
> >                   ENDCASE
> >                   SKIP 1 IN inwardbo
> >                ENDDO
> >             ENDIF
> >             LOCAL xxavgwt,xxweftwt
> >             STORE 0 TO xxavgwt,xxweftwt
> >             xxavgwt=ROUND(xxwtbal/xxcutbal,3)*inward1.taka
> >             xxweftwt=(inward1.weight-xxavgwt)
> > 
> >             IF xxwtbal=0
> >                IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                   DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                      IF UPPER(pcode2.yarntype)='WARP'
> >                         APPEND BLANK IN wstkrep
> >                         REPLACE ;
> >                         wstkrep.DATE WITH rep.ldate-1, ;
> >                         wstkrep.pcode WITH pcode2.yarncode, ;
> >                         wstkrep.accode WITH inward1.accode ;
> >                         IN wstkrep
> >                         REPLACE wstkrep.opbal WITH wstkrep.opbal -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                         REPLACE wstkrep.opbalwarp WITH wstkrep.opbalwarp -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      ENDIF
> >                      IF UPPER(pcode2.yarntype)='WEFT'
> >                         APPEND BLANK IN wstkrep
> >                         REPLACE ;
> >                         wstkrep.DATE WITH rep.ldate-1, ;
> >                         wstkrep.pcode WITH pcode2.yarncode, ;
> >                         wstkrep.accode WITH inward1.accode ;
> >                         IN wstkrep
> >                         REPLACE wstkrep.opbal WITH wstkrep.opbal -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                         REPLACE wstkrep.opbalweft WITH wstkrep.opbalweft -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      ENDIF
> >                      SKIP 1 IN pcode2
> >                   ENDDO
> >                ENDIF
> >             ENDIF
> >             IF xxwtbal#0
> >                IF SEEK(inward1.beamno,'inward12bo','beamno')
> >                   DO WHILE inward12bo.beamno=inward1.beamno AND NOT EOF('inward12bo')
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH rep.ldate-1, ;
> >                      wstkrep.pcode WITH inward12bo.pcode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.opbal WITH wstkrep.opbal -ROUND((xxavgwt*inward12bo.yarnp/100),3)  IN wstkrep
> >                      REPLACE wstkrep.opbalwarp WITH wstkrep.opbalwarp -ROUND((xxavgwt*inward12bo.yarnp/100),3)  IN wstkrep
> >                      SKIP 1 IN inward12bo
> >                   ENDDO
> >                ENDIF
> >                IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                   DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                      IF UPPER(pcode2.yarntype)='WEFT'
> >                         APPEND BLANK IN wstkrep
> >                         REPLACE ;
> >                         wstkrep.DATE WITH rep.ldate-1, ;
> >                         wstkrep.pcode WITH pcode2.yarncode, ;
> >                         wstkrep.accode WITH inward1.accode ;
> >                         IN wstkrep
> >                         REPLACE wstkrep.opbal WITH wstkrep.opbal -ROUND((xxweftwt*pcode2.yarnp/100),3)  IN wstkrep
> >                         REPLACE wstkrep.opbalweft WITH wstkrep.opbalweft -ROUND((xxweftwt*pcode2.yarnp/100),3)  IN wstkrep
> >                      ENDIF
> >                      SKIP 1 IN pcode2
> >                   ENDDO
> >                ENDIF
> >             ENDIF
> > 
> >          CASE INLIST(inward1.STATUS,'G2','G4')
> >             IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                   IF UPPER(pcode2.yarntype)='WARP'
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH rep.ldate-1, ;
> >                      wstkrep.pcode WITH pcode2.yarncode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.opbal WITH wstkrep.opbal -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      REPLACE wstkrep.opbalweft WITH wstkrep.opbalweft -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                   ENDIF
> >                   IF UPPER(pcode2.yarntype)='WEFT'
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH rep.ldate-1, ;
> >                      wstkrep.pcode WITH pcode2.yarncode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.opbal WITH wstkrep.opbal -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      REPLACE wstkrep.opbalweft WITH wstkrep.opbalweft -ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                   ENDIF
> >                   SKIP 1 IN pcode2
> >                ENDDO
> >             ENDIF
> > 
> >          CASE INLIST(inward1.STATUS,'BI') AND inward1.DATE>=zstartdate
> >             IF SEEK(inward1.beamno,'inward','billno')
> >                DO WHILE inward.billno=inward1.beamno AND NOT EOF('inward')
> >                   IF inward.issucode=inward1.accode AND (inward.STATUS='BJ' OR inward.STATUS=inward1.flg1)
> >                      IF SEEK(inward.reco1,'inward12','reco1')
> >                         DO WHILE inward12.reco1=inward.reco1 AND NOT EOF('inward12')
> >                            mkey=inward.issucode+inward12.pcode+DTOS(rep.ldate-1)
> >                            IF NOT SEEK(mkey,'wstkrep','wstkrep1')
> >                               APPEND BLANK IN wstkrep
> >                               REPLACE ;
> >                               wstkrep.DATE WITH rep.ldate-1, ;
> >                               wstkrep.pcode WITH inward12.pcode, ;
> >                               wstkrep.accode WITH inward1.accode ;
> >                               IN wstkrep
> >                            ENDIF
> >                            REPLACE opbal WITH opbal+inward12.beamwt IN wstkrep
> >                            REPLACE opbalwarp WITH opbalwarp+inward12.beamwt IN wstkrep
> >                            SKIP 1 IN inward12
> >                         ENDDO
> >                      ENDIF
> >                   ENDIF
> >                   SKIP 1 IN inward
> >                ENDDO
> >             ENDIF
> > 
> >          CASE INLIST(inward1.STATUS,'BI') AND inward1.DATE<zstartdate
> >             IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                   IF UPPER(pcode2.yarntype)='WARP'
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH rep.ldate-1, ;
> >                      wstkrep.pcode WITH pcode2.yarncode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.opbal WITH wstkrep.opbal +ROUND((inward1.weight*pcode2.yarnp/100),3)  IN wstkrep
> >                      REPLACE wstkrep.opbalwarp WITH wstkrep.opbalwarp +ROUND((inward1.weight*pcode2.yarnp/100),3)  IN wstkrep
> >                   ENDIF
> >                   SKIP 1 IN pcode2
> >                ENDDO
> >             ENDIF
> >          ENDCASE
> > 
> >       CASE BETWEEN(inward1.DATE,rep.ldate,rep.ldate1)
> >          IF INLIST(inward1.STATUS,'RB','IW','IS','RW','RS','WW','SW')
> >             APPEND BLANK IN wstkrep
> >             REPLACE ;
> >             wstkrep.DATE WITH inward1.DATE, ;
> >             wstkrep.dno WITH inward1.dno, ;
> >             wstkrep.pcode WITH inward1.pcode, ;
> >             wstkrep.accode WITH inward1.accode ;
> >             IN wstkrep
> >          ENDIF
> > 
> >          DO CASE
> >          CASE INLIST(inward1.STATUS,'IW','IS')
> >             REPLACE stkin WITH stkin+inward1.weight IN wstkrep
> >             REPLACE stkinweft WITH stkinweft+inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'RS','RW')
> >             REPLACE retout WITH retout+inward1.weight IN wstkrep
> >             REPLACE retoutweft WITH retoutweft+inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'WW','SW')
> >             REPLACE wast WITH wast+inward1.weight IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'RB')
> >             REPLACE retout WITH retout +inward1.beamwt IN wstkrep
> >             REPLACE retoutwarp WITH retoutwarp+inward1.beamwt IN wstkrep
> > 
> >          CASE INLIST(inward1.STATUS,'G1','G3')
> >             LOCAL xxcutbal, xxwtbal
> >             STORE 0 TO xxcutbal, xxwtbal
> >             IF SEEK(inward1.beamno,'inwardbo','billno')
> >                DO WHILE inwardbo.billno=inward1.beamno AND NOT EOF('inwardbo')
> >                   DO CASE
> >                   CASE inwardbo.issucode=inward1.accode AND INLIST(inwardbo.STATUS,'BO','BJ','RB')
> >                      xxcutbal=xxcutbal+inwardbo.totcut
> >                      xxwtbal=xxwtbal+inwardbo.beamwt
> >                   CASE inwardbo.accode=inward1.accode AND inwardbo.STATUS='RB'
> >                      xxcutbal=xxcutbal-inwardbo.totcut
> >                      xxwtbal=xxwtbal-inwardbo.beamwt
> >                   ENDCASE
> >                   SKIP 1 IN inwardbo
> >                ENDDO
> >             ENDIF
> >             LOCAL xxavgwt,xxweftwt
> >             STORE 0 TO xxavgwt,xxweftwt
> >             xxavgwt=ROUND(xxwtbal/xxcutbal,3)*inward1.taka
> >             xxweftwt=(inward1.weight-xxavgwt)
> > 
> >             IF xxwtbal=0
> >                IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                   DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                      IF UPPER(pcode2.yarntype)='WARP'
> >                         APPEND BLANK IN wstkrep
> >                         REPLACE ;
> >                         wstkrep.DATE WITH inward1.DATE, ;
> >                         wstkrep.pcode WITH pcode2.yarncode, ;
> >                         wstkrep.accode WITH inward1.accode ;
> >                         IN wstkrep
> >                         REPLACE wstkrep.issout WITH wstkrep.issout +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                         REPLACE wstkrep.issoutwarp WITH wstkrep.issoutwarp +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      ENDIF
> >                      IF UPPER(pcode2.yarntype)='WEFT'
> >                         APPEND BLANK IN wstkrep
> >                         REPLACE ;
> >                         wstkrep.DATE WITH inward1.DATE, ;
> >                         wstkrep.pcode WITH pcode2.yarncode, ;
> >                         wstkrep.accode WITH inward1.accode ;
> >                         IN wstkrep
> >                         REPLACE wstkrep.issout WITH wstkrep.issout +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                         REPLACE wstkrep.issoutweft WITH wstkrep.issoutweft +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      ENDIF
> >                      SKIP 1 IN pcode2
> >                   ENDDO
> >                ENDIF
> >             ENDIF
> >             IF xxwtbal#0
> >                IF SEEK(inward1.beamno,'inward12bo','beamno')
> >                   DO WHILE inward12bo.beamno=inward1.beamno AND NOT EOF('inward12bo')
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH inward1.DATE, ;
> >                      wstkrep.pcode WITH inward12bo.pcode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.issout WITH wstkrep.issout +ROUND((xxavgwt*inward12bo.yarnp/100),3)  IN wstkrep
> >                      REPLACE wstkrep.issoutwarp WITH wstkrep.issoutwarp +ROUND((xxavgwt*inward12bo.yarnp/100),3) IN wstkrep
> >                      SKIP 1 IN inward12bo
> >                   ENDDO
> >                ENDIF
> >                IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                   DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                      IF UPPER(pcode2.yarntype)='WEFT'
> >                         APPEND BLANK IN wstkrep
> >                         REPLACE ;
> >                         wstkrep.DATE WITH inward1.DATE, ;
> >                         wstkrep.pcode WITH pcode2.yarncode, ;
> >                         wstkrep.accode WITH inward1.accode ;
> >                         IN wstkrep
> >                         REPLACE wstkrep.issout WITH wstkrep.issout +ROUND((xxweftwt*pcode2.yarnp/100),3)  IN wstkrep
> >                         REPLACE wstkrep.issoutweft WITH wstkrep.issoutweft +ROUND((xxweftwt*pcode2.yarnp/100),3)  IN wstkrep
> >                      ENDIF
> >                      SKIP 1 IN pcode2
> >                   ENDDO
> >                ENDIF
> >             ENDIF
> > 
> >          CASE INLIST(inward1.STATUS,'G2','G4')
> >             IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                   IF UPPER(pcode2.yarntype)='WARP'
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH inward1.DATE, ;
> >                      wstkrep.pcode WITH pcode2.yarncode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.issout WITH wstkrep.issout +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      REPLACE wstkrep.issoutweft WITH wstkrep.issoutweft +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                   ENDIF
> >                   IF UPPER(pcode2.yarntype)='WEFT'
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH inward1.DATE, ;
> >                      wstkrep.pcode WITH pcode2.yarncode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.issout WITH wstkrep.issout +ROUND((inward1.weight*pcode2.yarnp1/100),3)  IN wstkrep
> >                      REPLACE wstkrep.issoutweft WITH wstkrep.issoutweft +ROUND((inward1.weight*pcode2.yarnp1/100),3) IN wstkrep
> >                   ENDIF
> >                   SKIP 1 IN pcode2
> >                ENDDO
> >             ENDIF
> > 
> >          CASE INLIST(inward1.STATUS,'BI') AND inward1.DATE>=zstartdate
> >             IF SEEK(inward1.beamno,'inward','billno')
> >                DO WHILE inward.billno=inward1.beamno AND NOT EOF('inward')
> >                   IF inward.issucode=inward1.accode AND (inward.STATUS='BJ' OR inward.STATUS=inward1.flg1)
> >                      IF SEEK(inward.reco1,'inward12','reco1')
> >                         DO WHILE inward12.reco1=inward.reco1 AND NOT EOF('inward12')
> >                            APPEND BLANK IN wstkrep
> >                            REPLACE ;
> >                            wstkrep.DATE WITH inward1.DATE, ;
> >                            wstkrep.pcode WITH inward12.pcode, ;
> >                            wstkrep.accode WITH inward1.accode ;
> >                            IN wstkrep
> >                            REPLACE wstkrep.stkin WITH wstkrep.stkin+inward12.beamwt IN wstkrep
> >                            REPLACE wstkrep.stkinwarp WITH wstkrep.stkinwarp+inward12.beamwt IN wstkrep
> >                            SKIP 1 IN inward12
> >                         ENDDO
> >                      ENDIF
> >                   ENDIF
> >                   SKIP 1 IN inward
> >                ENDDO
> >             ENDIF
> > 
> >          CASE INLIST(inward1.STATUS,'BI') AND inward1.DATE<zstartdate
> >             IF SEEK(inward1.dnocode,'pcode2','dnocode')
> >                DO WHILE pcode2.dnocode=inward1.dnocode AND NOT EOF('pcode2')
> >                   IF UPPER(pcode2.yarntype)='WARP'
> >                      APPEND BLANK IN wstkrep
> >                      REPLACE ;
> >                      wstkrep.DATE WITH inward1.DATE, ;
> >                      wstkrep.pcode WITH pcode2.yarncode, ;
> >                      wstkrep.accode WITH inward1.accode ;
> >                      IN wstkrep
> >                      REPLACE wstkrep.stkin WITH wstkrep.stkin+ROUND((inward1.weight*pcode2.yarnp/100),3)  IN wstkrep
> >                      REPLACE wstkrep.stkinwarp WITH wstkrep.stkinwarp+ROUND((inward1.weight*pcode2.yarnp/100),3)  IN wstkrep
> >                   ENDIF
> >                   SKIP 1 IN pcode2
> >                ENDDO
> >             ENDIF
> >          ENDCASE
> >       ENDCASE
> >    ENDIF
> >    xxval2=xxval2+1
> >    SKIP 1 IN inward1
> > ENDDO
> > USE IN SELECT('INWARD12')
> > USE IN SELECT('INWARD12bo')
> > USE IN SELECT('INWARDbo')
> > USE IN SELECT('INWARD12bi')
> > 
> > 

> >
> > https://www.foxite.com/uploads/2d4c594a-1819-4ee0-8fc1-928775731245.rar
> > https://www.foxite.com/uploads/ff228dc9-9d76-401f-814a-7b8c8b27f6a1.rar
> > https://www.foxite.com/uploads/e64fd596-90f6-4e71-8370-b4742c110b87.rar
> > https://www.foxite.com/uploads/8eaab042-b886-41ab-864d-dc34a78ad9df.rar
> > https://www.foxite.com/uploads/06c97b4b-9f67-4e93-883f-f8b12fed2fed.rar
> > https://www.foxite.com/uploads/e406d68a-6143-4ded-ae2f-9d985a55c4bb.rar
> > https://www.foxite.com/uploads/08dd3dcb-4811-4927-94fe-6c75dd9b56a6.rar
> >
> > warm regards,
> > mk.
> Filters are always slow even very slow on big files. i have not seen what u wrote. but i suggest just make cursor rather than filtering tables that will faster. and can u brief us what u wana achieve with this table? might there is shorter version there..
>
>
> Anil
>
> My Blog

ENTIRE THREAD

how to optimize/fast this Posted by mk sharma @ 7/13/2010 8:33:26 PM
RE: how to optimize/fast this Posted by Anil Sharma @ 7/13/2010 8:44:44 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/13/2010 8:59:49 PM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 3:17:33 AM
RE: how to optimize/fast this Posted by mk sharma @ 7/14/2010 8:18:12 AM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 10:21:01 AM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 10:59:55 AM
RE: how to optimize/fast this Posted by mk sharma @ 7/14/2010 11:58:18 AM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 12:19:49 PM
RE: how to optimize/fast this Posted by Jun Tangunan @ 7/14/2010 12:23:28 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/14/2010 8:00:52 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/14/2010 10:40:06 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/15/2010 8:36:51 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/15/2010 6:31:43 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/16/2010 6:31:23 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/16/2010 6:59:23 AM
RE: how to optimize/fast this Posted by Samir H. @ 7/16/2010 7:43:23 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/16/2010 7:25:46 PM
RE: how to optimize/fast this Posted by mk sharma @ 7/16/2010 7:48:03 AM
RE: how to optimize/fast this Posted by tushar @ 7/16/2010 8:05:16 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/16/2010 7:30:36 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/15/2010 2:27:34 PM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/15/2010 6:30:23 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/17/2010 8:01:16 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/18/2010 7:30:27 PM
RE: how to optimize/fast this Posted by Binod Binani @ 7/19/2010 9:49:06 AM
RE: how to optimize/fast this Posted by Mike Yearwood @ 7/19/2010 3:03:16 PM
RE: how to optimize/fast this Posted by Samir H. @ 7/14/2010 3:51:21 AM