[EpiData-list] relational databases- using a mother file field in a check for a child file field

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Sun Nov 26 23:54:24 CST 2006


Dear listers,

I have created a relational EpiData database where the value of a field 
called RECDATE is automatically passed from the mother file to the related 
child file. This works fine. I have a field in the child file called DATE 
and wish to ensure that DATE is always later than RECDATE. I have tried the 
following check:

date
   AFTER ENTRY
     IF DATE< RECDATE THEN
       HELP "The date can't be earlier than the date of recruitment" TYPE=ERROR
     ENDIF
   END
END

And I get the following error:

Error in IF expression: Invalid parameters to DATE.

Does anyone have any advice on using automatically passed variables in 
checks? All help is much appreciated. In case it helps, here is the start 
of my child.chk file.

BEFORE RECORD
   RECDATE=varRECDATE
END

id
   KEY 1
END

recdate
   NOENTER
END

date
   RANGE 1/1/2006 31/12/2007
   LEGAL
     1/1/1800
     1/1/1900
   END
   AFTER ENTRY
     IF DATE< RECDATE THEN
       HELP "The date can't be earlier than the date of recruitment" TYPE=ERROR
     ENDIF
   END
END

Katherine Smith
Research Assistant
Clinical Epidemiology and Biostatistics Unit (CEBU)
Murdoch Childrens Research Institute
(03) 9345 7957
katherine.smith at mcri.edu.au


More information about the EpiData-list mailing list