Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get all employee
Message
De
10/02/2005 08:29:59
 
 
À
10/02/2005 08:04:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 5
Database:
Visual FoxPro
Divers
Thread ID:
00985090
Message ID:
00985512
Vues:
27
hi,
for your sugest ,If you want all employees, why not use a query to get them all, joining the two tables and avoid the SCAN altogether?
i don't have any idea how,

i make this + some operations via my code under it works,no problem but i think it is old way,
i need to see new ways ,faster not much code
close all
set talk off
set echo off
set safety off

   select 22
     use newtax excl
     zap

     select 4
     use tax1
     index on no to kkk

     m.no=no
     m.nettot=nettot
     m.nam=nam
     m.nam2=nam2
     m.nam3=nam3
     m.nam4=nam4
     m.month1=monthnam

     select 4
     do while .t.

     scatter memvar
     m.aa=nettot
    select 5
    use tax2
    append blank
    gather memvar

select 1
use mstr
locate for no=m.no
m.dat=dat
M.NATI=NATI
M.CHILD=CHILD
M.STAT1=STAT1
M.RNTPLAC=RNTPLAC
M.AS1=0
M.UNV=UNV
M.UNV1=UNV1
M.UNV2=UNV2
M.UNV3=UNV3
M.UNV4=UNV4


       IF M.UNV<>SPACE(10)
          M.AS1=M.AS1+1
       ENDIF
       
       IF M.UNV1<>SPACE(10)
          M.AS1=M.AS1+1
       ENDIF


       IF M.UNV2<>SPACE(10)
          M.AS1=M.AS1+1
       ENDIF

       IF M.UNV3<>SPACE(10)
          M.AS1=M.AS1+1
        ENDIF

       IF M.UNV4<>SPACE(10)
          M.AS1=M.AS1+1
       ENDIF
   
       replace dat with m.dat
       replace NATI with m.NATI
       replace CHILD with m.CHILD
       REPLACE RNTPLAC WITH M.RNTPLAC

   IF M.STAT1="&#1605;&#1578;&#1586;&#1608;&#1580;     "
      REPLACE STAT1 WITH "&#1605;&#1578;&#1586;&#1608;&#1580; "
   ELSE
      REPLACE STAT1 WITH "&#1575;&#1593;&#1586;&#1576;"
   ENDIF



select 4
skip
if m.no<>no
  select 5
  use tax2 excl
  index on no to kk
  go top
  set filter to no=m.no
  count to df
  sum nettot to kk for m.no=no
  sum totcut to ll for m.no=no
  sum cut5 to ee for m.no=no
  sum cut4 to tt for m.no=no
  sum MSAL to ff for m.no=no
  sum cut1 to cx for m.no=no
  sum cut2 to ew for m.no=no
  sum cut3 to ty for m.no=no
  sum allad to qty for m.no=no
  sum vdisc to tareq for m.no=no
  SUM TOTALADD TO ERT for m.no=no
  M.ERT1=ERT-tareq

  select 22
  use newtax
  append blank
  gather memvar
   replace no with m.no
   replace totalsal with kk
   replace totcut with ll
   replace cut5 with ee
   replace cut4 with tt
   replace MSAL with ff
   replace cut1 with cx
   replace cut2 with ew
   replace cut3 with ty
   replace allad with qty
   replace countt with df
   replace total with (kk+ll)-(cx+ew+ty)
   replace AS1 with m.AS1
   replace vdisc with tareq
   replace TOTALADD with M.ERT1

    select 5
      use tax2 excl
      index on no to kk
      report form COPtax1 
      zap
endif

   select 4
     m.no=no
     m.nam=nam
     m.nam2=nam2
     m.nam3=nam3
     m.nam4=nam4
     m.month1=monthnam
  if eof()
      exit
     else
  endif

enddo
thanks .
best regards



>ok, i try as under but no skip to another emplyee he get the first employee evry time
>>
>>CLOSE ALL
>>
>>USE MSTR IN 0
>>SELECT MSTR
>>M.DAT=DAT
>>USE tax1 IN 0
>>SELECT tax1
>>
>>m.no=NO
>>m.nMin=1
>>m.nMax=15
>>scan WHILE no=M.NO
>>Select *from tax1 where no=m.no and montno between m.nMin and m.nMax into cursor employees
>>report form coptax111 preview
>>Select tax1 &&or select mstr
>>ENDscan
>>

>
>Note that ENDSCAN returns the area to the starting one. If you say SCAN WHILE you must have an index tag in Tax1 for no and the proper employee has to be selected.
>
>If you want all employees, why not use a query to get them all, joining the two tables and avoid the SCAN altogether?
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform