Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating groups of similar records
Message
 
 
À
25/10/2001 14:57:15
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00573329
Message ID:
00573336
Vues:
17
>I have a table that looks similar to this:
>prempl txqtr taxid qtax qbase qwage ytax ybase ywage ...
>50000___1__futa__0.0__0.0___0.0__1.0___1.0___1.0
>50000___1__suta__0.0__0.0___0.0__1.0___1.0___1.0
>50000___1__fica__0.0__0.0___0.0__1.0___1.0___1.0
>50000___2__futa__0.0__0.0___0.0__1.0___1.0___1.0
>50000___2__suta__0.0__0.0___0.0__1.0___1.0___1.0
>50000___2__fica__0.0__0.0___0.0__1.0___1.0___1.0
>50001___1__futa__1.0__1.0___1.0__1.0___1.0___1.0
>50001___1__suta__1.0__1.0___1.0__1.0___1.0___1.0
>50001___1__fica__1.0__1.0___1.0__1.0___1.0___1.0
>50001___2__futa__1.0__1.0___1.0__1.0___1.0___1.0
>50001___2__suta__1.0__1.0___1.0__1.0___1.0___1.0
>50001___2__fica__1.0__1.0___1.0__1.0___1.0___1.0
>50002___1__futa__0.0__0.0___0.0__1.0___1.0___1.0
>50002___1__suta__0.0__0.0___0.0__1.0___1.0___1.0
>50002___1__fica__0.0__0.0___0.0__1.0___1.0___1.0
>50002___2__futa__1.0__1.0___1.0__1.0___1.0___1.0
>50002___2__suta__1.0__1.0___1.0__1.0___1.0___1.0
>50002___2__fica__1.0__1.0___1.0__1.0___1.0___1.0
>I want to update the ytd fields for only the employees with zeros in the qtax, qbase, and qwage fields for all the records for a given employee. If there is anything greater than zero in any record for a given employee, I want to leave that employee alone. I know I need to read all the records and figure out which employees have all zeros in those fields in every record for that employee, and then skip back to those records to update them. How can I do this?
Select employeID, sum(qtax+qbase+qwage) as SumFld group by 1 having SumFld=0 into cursor curNeedUpdate
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform