Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Wrong calculation first time through.
Message
De
06/06/2007 08:56:56
 
 
À
06/06/2007 08:50:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Divers
Thread ID:
01230884
Message ID:
01230888
Vues:
12
>>Has anybody run into this sort of strange anomaly in the VFP reports?
>>
>>I have a function that returns a person's age in years. The call is "Calcage(BirthDate, EndDate)"
>>On an employee screen, I have a display field that shows the person's age at the time of an accident. What is displayed is:
>>
>>Calcage(cd_emp.em_birthdt, cl_claim.cl_occ_dt)
>>
>>In my test system, I have person 'A' born 07/14/1953 and the accident date is 07/04/2000. The form displays the correct age as 46
>>I have another person 'B' born 05/07/1980 and the accident is on 09/20/2000. The form displays the correct age as 20.
>>
>>On the report, I have a field to display age, and in the field, the expression is:
>>
>>Calcage(cd_emp.em_birthdt, cl_claim.cl_occ_dt) - identical to the form's display field.
>>
>>The tables are related through another table (cl_emp) like this: cl_emp has an id field that relates to the claim table's id field, and cd_emp has an employee # field that relates to the employee # in the cl_emp table. So it works like this, after setting the appropriate index tags,
>>
>>Select cl_claim
>>set relation to cl_claimid into cl_emp additive
>>Select cl_emp
>>set relation to ce_empno into cd_emp additive
>>
>>The first time I run the report, I get person A showing age 42, and person B showing age 15. I can run the report over and over and I get those wrong ages.
>>
>>Now, here is the big HOWEVER. If I go back to the form and double check the information shown on either one of the people, it shows the correct age. Then if I go back and run the report again, now they both show the correct ages.
>>
>>If I quit the system entirely and come back in and run the report, the ages are wrong again.
>>
>>Anybody got any idea what I might look for to figure this out?
>>
>>BTW, the rest of the information on the report for these items seems to be ok, so I'm sure the correct records are being found in the relations for the reports display.
>
>
>Alan,
>
>Maybe some relation with faq#15515 ?

Thanks, I'll be aware of that from now on, but unfortunately, that is not my current problem.

When I run the report, the last focus is on the screen where I click a button to produce the report. In fact there are no grids open anywhere. The closest thing is a list control that is on a screen underneath the active screen, so it doesn't have focus either.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform