[EpiData-list] Re calculation formula

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Wed Sep 14 15:14:48 CDT 2005


Try this:

HOURS
  AFTER ENTRY
    totalhours=(days*24)+integer(hours)
  END
END

I assume that the "hours" field is an integer field. I
experienced - as you have - that entering "00" in the hours field
results in zero. This seems to be a small bug in EpiData.

But if you typecast the hours field to integer, then entering
"00" works because "00" is typecast into the integer value 0.

Regards
Michael Bruus
EpiData Association


----- Original Message ----- 
From: <epidata-list at lists.umanitoba.ca>
To: <epidata-list at lists.umanitoba.ca>
Sent: Wednesday, September 14, 2005 2:19 PM
Subject: [EpiData-list] Re calculation formula


Hello!
I need to calculate the sum of hours and days, in form of hours.
So I did the formula as : total hours = days*24 + hours
So when you have one day of time to be registered, and you have
no
umber of hours (i.e. zero), it is writting as "00" (two digits of
zeros), then the "total hours" would give answer as "0", even
though
the number 1 is writting in days.
When I triy to write the zero, as one digit (i.e. "0"), then it
works fine.
Any tip how to overcome it?

Here is below a copy of the formula:
d8
  MUSTENTER
  AFTER ENTRY
    LET d10=d9*24 + d8
  END
END



Thank you in advance!
/Ziad

-- 
Ziad El-Khatib
Division of International Health Care and Research (IHCAR)
Department of Public Health Sciences
Karolinska Institutet
_______________________________________________
EpiData-list mailing list
EpiData-list at lists.umanitoba.ca
http://lists.umanitoba.ca/mailman/listinfo/epidata-list



More information about the EpiData-list mailing list