Information générale
Catégorie:
Gestionnaire de rapports & Rapports
Titre:
Wrong calculation first time through.
Versions des environnements
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.
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement