Hello, I have a little problam calculating intervals like age from two dates using formula
LET AGE=ROUND(INT(TODAY-DOB)/365.25)
It returns the value rounded to the nearest whole number, which is a problem in records of people with birthday 6 and more months (183 days and more) from today's date, as it makes them one year older.. Is there any way to get result rounded towards zero?
Kind regards
Eva
epidata-list@lists.umanitoba.ca wrote:
Instead of using "round" use the function "trunc" - it extracts only the integer part of the number, effectively rounding towards zero.
LET AGE = TRUNC(INT(TODAY - DOB) / 365.25)
Kind regards, Torsten Bonde Christiansen. EpiData Software Developer.
As part of current development there is an issue of how time is best represented in data.
Recent years have added a date-time field to some database systems. In most cases for entry these are rather cumbersome to work with in practice in my experience.
The suggestion is to add one time field: hh.mm.ss that is a time field with 6 digits. examples: Entered recorded 1 01.00.00 (one o'clock at night) 122 12.20.00 (20 minutes past twelwe) 182045 18.20.45 (20 minutes,45 seconds after 18 hours)
Functions will be needed e.g. to calculate time in hours, minutes or seconds from day1 time1 to day2 time2. Or conversion of an imported date-time value to separate the date into one field and the time into another.
Users are encouraged to give examples and discuss here on the list regarding: a. Needs for recording of time b. Examples of practical situations where this was needed c. In what format would users prefer recording.
Also whether there seems to be a need for a combined date-time field.
regards Jens Lauritsen EpiData Association
Time is frequently used in food-borne outbreak investigations (especially in cohort studies). Time in hours would normally be more important than hours and minutes. Seconds would never be used.
If time is only in hours, no special field is required; just make ## and allow only 0-24. For hours and minutes, the format ##:## or ##.## or ##h## (French) should be allowed, with the separator specified as for date, decimal or thousands separators.
Functions that handle ##.## times or just ## times would result in fractional days.
e.g. onset = onsetdate + time2day(onsettime) // results in fractional day that could be formatted for output as yyyy/mm/dd hh:mm or some similar arrangement. In the case of intervals, could format as ### days ##:##
e.g. start = time2day(starttime) // where starttime is ##:## results in fraction of a day: 0.xxxxx e.g. interval = time2day(finishtime) - time2day(starttime) // results in fraction like xx.xxxxx days where finishtime and starttime are date+fraction date fields (or as far as EpiData knows are simply real numbers.
In outbreaks, time is most useful when constructing epicurves or determining incubation times. Handling date/time in epicurves will be very useful, where the grouping of times into regular intervals (n hours, n days, n weeks, months) would be welcome.
Jamie Hockin Ottawa
2009/11/25 epidata-list@lists.umanitoba.ca
participants (1)
-
epidata-list@lists.umanitoba.ca